[Qemu-devel] [Bug 1629483] Re: Build fails on optionrom

2016-10-02 Thread David
I am seeing the same problem. Cross compiling QEMU 2.7 using buildroot get fatal error -c is not a valid option. As Benjamin states removing the -c flag from Makefile gets through the compile, but when booting a virtual image of Ubuntu 16.04 the network does not come up (console is live and you c

[Qemu-devel] [PATCH v5] Add resolutions via the command-line

2016-10-02 Thread G 3
Add the ability to add resolutions from the command-line. This patch works by looking for a property called 'fb-modes' in the QEMU,VGA node of OpenBIOS. If it is found all the resolutions are parsed and loaded. Example command-line: -prom-env resolutions=512x342,640x480,800x600,1024x600,1200

[Qemu-devel] [PATCH v3 13/16] vfio/pci: Conversion to realize

2016-10-02 Thread Eric Auger
This patch converts VFIO PCI to realize function. Also original initfn errors now are propagated using QEMU error objects. All errors are formatted with the same pattern: "vfio: %s: the error description" Signed-off-by: Eric Auger --- v2 -> v3: - use errp directly in all cases v1 -> v2: - corr

[Qemu-devel] [PATCH v3 15/16] vfio/pci: Remove vfio_populate_device returned value

2016-10-02 Thread Eric Auger
The returned value (either -errno or -1) is not used anymore by the caller, vfio_realize, since the error now is stored in the error object. So let's remove it. Signed-off-by: Eric Auger --- hw/vfio/pci.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git

[Qemu-devel] [PATCH v3 14/16] vfio/pci: Remove vfio_msix_early_setup returned value

2016-10-02 Thread Eric Auger
The returned value is not used anymore by the caller, vfio_realize, since the error now is stored in the error object. So let's remove it. Signed-off-by: Eric Auger --- Logically we could do that job for all the functions now getting an Error object passed as a parameter to avoid duplicate info

[Qemu-devel] [PATCH v3 09/16] vfio: Pass an error object to vfio_get_device

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. In vfio platform vfio_base_device_init we currently just report the error. Subsequent patches will propagate the error up to the realize function. Signed-off-by: Eric Auger --- hw/vfio/common.c | 13 +++-- h

[Qemu-devel] [PATCH v3 10/16] vfio/platform: Pass an error object to vfio_populate_device

2016-10-02 Thread Eric Auger
Propagate the vfio_populate_device errors up to vfio_base_device_init. The error object also is passed to vfio_init_intp. At the moment we only report the error. Subsequent patches will propagate the error up to the realize function. Signed-off-by: Eric Auger --- hw/vfio/platform.c | 25

[Qemu-devel] [PATCH v3 11/16] vfio/platform: fix a wrong returned value in vfio_populate_device

2016-10-02 Thread Eric Auger
In case the vfio_init_intp fails we currently do not return an error value. This patch fixes the bug. The returned value is not explicit but in practice the error object is the one used to report the error to the end-user and the actual returned error value is not used. Signed-off-by: Eric Auger

[Qemu-devel] [PATCH v3 08/16] vfio: Pass an error object to vfio_get_group

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. For the time being let's just simply report the error in vfio platform's vfio_base_device_init(). A subsequent patch will duly propagate the error up to vfio_platform_realize. Signed-off-by: Eric Auger --- v2 -> v3: - In the co

[Qemu-devel] [PATCH v3 04/16] vfio/pci: Pass an error object to vfio_msix_early_setup

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. The returned value will be removed later on. We now format an error in case of reading failure for - the MSIX flags - the MSIX table, - the MSIX PBA. Signed-off-by: Eric Auger --- v1 -> v2: - this patch now comes before the act

[Qemu-devel] [PATCH v3 12/16] vfio/platform: Pass an error object to vfio_base_device_init

2016-10-02 Thread Eric Auger
This patch propagates errors encountered during vfio_base_device_init up to the realize function. Signed-off-by: Eric Auger --- v3: creation --- hw/vfio/platform.c | 49 ++--- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/hw/vfio/pl

[Qemu-devel] [PATCH v3 16/16] vfio/pci: Handle host oversight

2016-10-02 Thread Eric Auger
In case the end-user calls qemu with -vfio-pci option without passing either sysfsdev or host property value, the device is interpreted as :00:00.0. Let's create a specific error message to guide the end-user. Signed-off-by: Eric Auger --- hw/vfio/pci.c | 11 +++ 1 file changed, 11 i

[Qemu-devel] [PATCH v3 06/16] vfio/pci: Pass an error object to vfio_add_capabilities

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. The error is cascaded downto vfio_add_std_cap and then vfio_msi(x)_setup, vfio_setup_pcie_cap. vfio_add_ext_cap does not return anything else than 0 so let's transform it into a void function. Also use pci_add_capability2 which ta

[Qemu-devel] [PATCH v3 03/16] vfio/pci: Pass an error object to vfio_populate_device

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. The returned value will be removed later on. The case where error recovery cannot be enabled is not converted into an error object but directly reported through error_report, as before. Populating an error instead would cause the f

[Qemu-devel] [PATCH v3 07/16] vfio/pci: Pass an error object to vfio_pci_igd_opregion_init

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. In vfio_probe_igd_bar4_quirk, simply report the error. Signed-off-by: Eric Auger --- hw/vfio/pci-quirks.c | 10 +- hw/vfio/pci.c| 3 +-- hw/vfio/pci.h| 3 ++- 3 files changed, 8 insertions(+), 8 deletio

[Qemu-devel] [PATCH v3 05/16] vfio/pci: Pass an error object to vfio_intx_enable

2016-10-02 Thread Eric Auger
Pass an error object to prepare for migration to VFIO-PCI realize. The error object is propagated down to vfio_intx_enable_kvm(). The three other callers, vfio_intx_enable_kvm(), vfio_msi_disable_common() and vfio_pci_post_reset() do not propagate the error and simply call error_reportf_err() wit

[Qemu-devel] [PATCH v3 02/16] vfio/pci: Pass an error object to vfio_populate_vga

2016-10-02 Thread Eric Auger
Pass an error object to prepare for the same operation in vfio_populate_device. Eventually this contributes to the migration to VFIO-PCI realize. We now report an error on vfio_get_region_info failure. vfio_probe_igd_bar4_quirk is not involved in the migration to realize and simply calls error_re

[Qemu-devel] [PATCH v3 00/16] Convert VFIO-PCI to realize

2016-10-02 Thread Eric Auger
This series converts VFIO-PCI to realize. It also aims at improving the error reporting in case of QMP hot-plug. Before the series, a device_add failure would have reported: {"error": {"class": "GenericError", "desc": "Device initialization failed"}}. Now the actual error cause is reported. A si

[Qemu-devel] [PATCH v3 01/16] vfio/pci: Use local error object in vfio_initfn

2016-10-02 Thread Eric Auger
To prepare for migration to realize, let's use a local error object in vfio_initfn. Also let's use the same error prefix for all error messages. On top of the 1-1 conversion, we start using a common error prefix for all error messages. We also introduce a similar warning prefix which will be used

[Qemu-devel] [PATCH] i8259: give ISA device when registering ISA ioports

2016-10-02 Thread Hervé Poussineau
Signed-off-by: Hervé Poussineau --- hw/intc/i8259_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/intc/i8259_common.c b/hw/intc/i8259_common.c index 3a850b0..d9a5e8b 100644 --- a/hw/intc/i8259_common.c +++ b/hw/intc/i8259_common.c @@ -70,10 +70,11 @@ static in

Re: [Qemu-devel] [PATCH 2/2] qemu-nbd: Add --image-size option

2016-10-02 Thread Tomáš Golembiovský
On Tue, 20 Sep 2016 13:45:08 +0200 Paolo Bonzini wrote: > On 20/09/2016 13:12, Daniel P. Berrange wrote: > > On Tue, Sep 20, 2016 at 11:59:28AM +0200, Paolo Bonzini wrote: > >> > >> > >> On 20/09/2016 11:41, Tomáš Golembiovský wrote: > >>> When image is part of the file it makes sense to li

[Qemu-devel] [PATCH] raw-posix: add 'offset' and 'size' options

2016-10-02 Thread Tomáš Golembiovský
Added two new options 'offset' and 'size'. This makes it possible to use only part of the file as a device. This can be used e.g. to limit the access only to single partition in a disk image or use a disk inside a tar archive (like OVA). For now this is only possible for files in read-only mode. I

[Qemu-devel] [PATCH 0/3] 9pfs: update some function declarations

2016-10-02 Thread Greg Kurz
This series drops useless extern annotations and adds some coroutine_fn in the 9pfs and fsdev code. It does not change any functionality. --- Greg Kurz (3): 9pfs: fsdev: drop useless extern annotation for functions 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch] 9pfs: us

[Qemu-devel] [PATCH 1/3] 9pfs: fsdev: drop useless extern annotation for functions

2016-10-02 Thread Greg Kurz
Signed-off-by: Greg Kurz --- fsdev/9p-marshal.h |6 ++- hw/9pfs/9p-synth.h | 10 +++-- hw/9pfs/9p.h| 18 +- hw/9pfs/coth.h | 94 ++- hw/9pfs/virtio-9p.h |2 + 5 files changed, 65 insertions(+), 65 deletions(-) d

[Qemu-devel] [PATCH v17 07/14] hw/ptimer: Add "no immediate reload" policy

2016-10-02 Thread Dmitry Osipenko
Immediate counter re-load on setting (or on starting to run with) counter = 0 is a wrong behaviour for some of the timers. Add "no immediate reload" policy that provides correct behaviour for such timers. Signed-off-by: Dmitry Osipenko --- hw/core/ptimer.c| 31 ++-

[Qemu-devel] [PATCH v17 01/14] hw/ptimer: Add "wraparound after one period" policy

2016-10-02 Thread Dmitry Osipenko
Currently, periodic counter wraps around immediately once counter reaches "0", this is wrong behaviour for some of the timers, resulting in one period being lost. Add new ptimer policy that provides correct behaviour for such timers, so that counter stays with "0" for a one period before wrapping a

[Qemu-devel] [PATCH 3/3] 9pfs: use coroutine_fn annotation in hw/9pfs/9p.[ch]

2016-10-02 Thread Greg Kurz
All these functions either call the v9fs_co_* functions which have the coroutine_fn annotation, or pdu_complete() which calls qemu_co_queue_next(). Let's mark them to make it obvious they execute in coroutine context. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c | 117

[Qemu-devel] [PATCH 2/3] 9pfs: use coroutine_fn annotation in hw/9pfs/co*.[ch]

2016-10-02 Thread Greg Kurz
All these functions use the v9fs_co_run_in_worker() macro, and thus always call qemu_coroutine_self() and qemu_coroutine_yield(). Let's mark them to make it obvious they execute in coroutine context. Signed-off-by: Greg Kurz --- hw/9pfs/codir.c | 17 ++ hw/9pfs/cofile.c | 32

[Qemu-devel] [PATCH v17 00/14] PTimer fixes/features and ARM MPTimer conversion

2016-10-02 Thread Dmitry Osipenko
Hello, Currently, QEMU ARM MPTimer device model provides only a certain subset of the emulation behavior. This patch series is supposed to add missing parts by converting the MPTimer to use generic ptimer helper. It fixes some important ptimer bugs and provides new features that are required for t

[Qemu-devel] [PATCH v17 02/14] tests: ptimer: Add tests for "wraparound after one period" policy

2016-10-02 Thread Dmitry Osipenko
PTIMER_POLICY_WRAP_AFTER_ONE_PERIOD changes ptimer behaviour in a such way, that it would wrap around after one period instead of doing it immediately. Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 127 ++-- 1 file changed, 104 insertion

[Qemu-devel] [PATCH v17 08/14] tests: ptimer: Add tests for "no immediate reload" policy

2016-10-02 Thread Dmitry Osipenko
PTIMER_POLICY_NO_IMMEDIATE_RELOAD makes ptimer to not to re-load counter on setting counter value to "0" or starting to run with "0". Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 73 + 1 file changed, 57 insertions(+), 16 deletions(

[Qemu-devel] [PATCH v17 14/14] tests: Add tests for the ARM MPTimer

2016-10-02 Thread Dmitry Osipenko
ARM MPTimer is a per-CPU core timer, essential part of the ARM Cortex-A9 MPCore. Add QTests for it. Signed-off-by: Dmitry Osipenko --- tests/Makefile.include |3 + tests/test-arm-mptimer.c | 1105 ++ 2 files changed, 1108 insertions(+) create mo

[Qemu-devel] [PATCH v17 10/14] tests: ptimer: Add tests for "no counter round down" policy

2016-10-02 Thread Dmitry Osipenko
PTIMER_POLICY_NO_COUNTER_ROUND_DOWN makes ptimer_get_count() return the actual counter value and not the one less. Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 117 ++-- 1 file changed, 76 insertions(+), 41 deletions(-) diff --git a/te

[Qemu-devel] [PATCH v17 05/14] hw/ptimer: Add "no immediate trigger" policy

2016-10-02 Thread Dmitry Osipenko
Performing trigger on setting (or starting to run with) counter = 0 could be a wrong behaviour for some of the timers, provide "no immediate trigger" policy to maintain correct behaviour for such timers. Signed-off-by: Dmitry Osipenko --- hw/core/ptimer.c| 20 include/hw

[Qemu-devel] [PATCH v17 09/14] hw/ptimer: Add "no counter round down" policy

2016-10-02 Thread Dmitry Osipenko
For most of the timers counter starts to decrement after first period expires. Due to rounding down performed by the ptimer_get_count, it returns counter - 1 for the running timer, so that for the ptimer user it looks like counter gets decremented immediately after running the timer. Add "no counte

[Qemu-devel] [PATCH v17 13/14] arm_mptimer: Convert to use ptimer

2016-10-02 Thread Dmitry Osipenko
Current ARM MPTimer implementation uses QEMUTimer for the actual timer, this implementation isn't complete and mostly tries to duplicate of what generic ptimer is already doing fine. Conversion to ptimer brings the following benefits and fixes: - Simple timer pausing implementation

[Qemu-devel] [PATCH v17 03/14] hw/ptimer: Add "continuous trigger" policy

2016-10-02 Thread Dmitry Osipenko
Currently, periodic timer that has load = delta = 0 performs trigger on timer reload and stops, printing a "period zero" error message. Introduce new policy that makes periodic timer to continuously trigger with a period interval in case of load = 0. Signed-off-by: Dmitry Osipenko --- hw/core/pt

[Qemu-devel] [PATCH v17 04/14] tests: ptimer: Add tests for "continuous trigger" policy

2016-10-02 Thread Dmitry Osipenko
PTIMER_POLICY_CONTINUOUS_TRIGGER makes periodic ptimer to re-trigger every period in case of load = delta = 0. Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 21 ++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/ptimer-test.c b/tests/ptimer-test

[Qemu-devel] [PATCH v17 06/14] tests: ptimer: Add tests for "no immediate trigger" policy

2016-10-02 Thread Dmitry Osipenko
PTIMER_POLICY_NO_IMMEDIATE_TRIGGER makes ptimer to not to trigger on starting to run with / setting counter to "0". Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 64 ++--- 1 file changed, 56 insertions(+), 8 deletions(-) diff --git a/te

[Qemu-devel] [PATCH v17 11/14] tests: ptimer: Change the copyright comment

2016-10-02 Thread Dmitry Osipenko
Eric Blake suggested that use of "Author:" in the copyright text of the files created by individuals is incorrect, replace it with "Copyright". Signed-off-by: Dmitry Osipenko --- tests/ptimer-test-stubs.c | 2 +- tests/ptimer-test.c | 2 +- tests/ptimer-test.h | 2 +- 3 files changed

[Qemu-devel] [PATCH v17 12/14] tests: ptimer: Replace 10000 with 1

2016-10-02 Thread Dmitry Osipenko
The 1 is an arbitrarily chosen value used for advancing the QEMU time, so that ptimer's now != last. Change it to 1 to make code a bit more readable. Signed-off-by: Dmitry Osipenko --- tests/ptimer-test.c | 56 ++--- 1 file changed, 28 insertio

Re: [Qemu-devel] [PATCH v2] timer: a9gtimer: check auto-increment register value

2016-10-02 Thread Peter Maydell
On 1 October 2016 at 23:15, P J P wrote: > Hello Peter, > > +-- On Fri, 30 Sep 2016, Peter Maydell wrote --+ > | Since the gtb->compare field is 64 bit your inc variable should > | probably be uint64_t. > > Okay. I was wondering about its values, as gtb->inc is 'uint32_t' type. The timer can

Re: [Qemu-devel] [PATCH v3 5/5] tests: enable virtio tests on SPAPR

2016-10-02 Thread Greg Kurz
On Sat, 1 Oct 2016 20:56:04 +0200 Laurent Vivier wrote: > but disable MSI-X tests on SPAPR as we can't check the result > (the memory region used on PC is not readable on SPAPR). > > Signed-off-by: Laurent Vivier > --- Reviewed-by: Greg Kurz > tests/Makefile.include| 3 ++- > tests/li

Re: [Qemu-devel] [PATCH v3 2/5] tests: don't check if qtest_spapr_boot() returns NULL

2016-10-02 Thread Greg Kurz
On Sat, 1 Oct 2016 20:56:01 +0200 Laurent Vivier wrote: > qtest_spapr_boot()/qtest_pc_boot()/qtest_boot() call qtest_vboot() > and qtest_vboot() calls g_malloc(), > and g_malloc() never fails: > if memory allocation fails, the application is terminated. > > Signed-off-by: Laurent Vivier > ---

Re: [Qemu-devel] [PATCH v3 1/5] tests: fix memory leak in virtio-scsi-test

2016-10-02 Thread Greg Kurz
On Sat, 1 Oct 2016 20:56:00 +0200 Laurent Vivier wrote: > vs is allocated in qvirtio_scsi_pci_init() and never freed. > > Signed-off-by: Laurent Vivier > --- Reviewed-by: Greg Kurz > tests/virtio-scsi-test.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/virtio-scsi-test.c