[Qemu-devel] [PATCHv8 0/3] fw_cfg: qdev-related tidy-ups

2017-07-11 Thread Mark Cave-Ayland
As part of some ongoing sun4u work, I need to be able to wire the fw_cfg IO interface to a separate IO space by instantiating the qdev device instead of calling fw_cfg_init_io(). This patchset brings FW_CFG_IO in line with FW_CFG_MEM and tidies up the realize methods accordingly. Signed-off-by: Ma

[Qemu-devel] [PATCHv8 1/3] fw_cfg: switch fw_cfg_find() to locate the fw_cfg device by type rather than path

2017-07-11 Thread Mark Cave-Ayland
This will enable the fw_cfg device to be placed anywhere within the QOM tree regardless of its machine location. Note that we also add a comment to document the behaviour that we return NULL to indicate failure where either no fw_cfg device or multiple fw_cfg devices are found. Signed-off-by: Mar

Re: [Qemu-devel] [PATCH v3 3/7] tests: add simple vmcoreinfo test

2017-07-11 Thread Laszlo Ersek
On 07/11/17 12:30, Marc-André Lureau wrote: > This test is based off vmgenid test from Ben Warren > . It simply checks the vmcoreinfo ACPI device > is present and that the memory region associated can be read. > > Signed-off-by: Marc-André Lureau > --- > tests/vmcoreinfo-test.c | 127 >

Re: [Qemu-devel] [PATCH v2] specs: Describe the TPM support in QEMU

2017-07-11 Thread Laszlo Ersek
On 07/11/17 16:31, Stefan Berger wrote: > This patch adds a description of the current TPM support in QEMU > to the specs. > > Several public specs are referenced via their landing page on the > trustedcomputinggroup.org website. > > Signed-off-by: Stefan Berger > > --- > > v1->v2: > - fixed

Re: [Qemu-devel] [PATCH v12 02/27] cpu-exec: Avoid global variables in icount-related functions

2017-07-11 Thread Alex Bennée
Lluís Vilanova writes: > Signed-off-by: Lluís Vilanova I guess. I assume this is also something Emilio is targeting with his multi-threaded translation work. Reviewed-by: Alex Bennée > --- > include/exec/gen-icount.h | 10 ++ > 1 file changed, 6 insertions(+), 4 deletions(-) > >

Re: [Qemu-devel] [PATCH v12 01/27] Pass generic CPUState to gen_intermediate_code()

2017-07-11 Thread Alex Bennée
Lluís Vilanova writes: > Needed to implement a target-agnostic gen_intermediate_code() in the > future. > > Signed-off-by: Lluís Vilanova > Reviewed-by: David Gibson > Reviewed-by: Richard Henderson Reviewed-by: Alex Bennée > --- > accel/tcg/translate-all.c |2 +- > include/exec/e

Re: [Qemu-devel] [PATCH v3 4/6] target/arm/translate: ensure gen_goto_tb sets exit flags

2017-07-11 Thread Alex Bennée
Richard Henderson writes: > On 07/11/2017 07:59 AM, Alex Bennée wrote: >> if (use_goto_tb(s, dest)) { >> tcg_gen_goto_tb(n); >> gen_set_pc_im(s, dest); >> tcg_gen_exit_tb((uintptr_t)s->tb + n); >> +s->is_jmp = DISAS_TB_JUMP; >> } else { >>

Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature

2017-07-11 Thread Michael S. Tsirkin
On Tue, Jul 11, 2017 at 05:49:07PM +0100, Peter Maydell wrote: > On 11 July 2017 at 16:22, Peter Maydell wrote: > > On 11 July 2017 at 16:07, Ben Warren wrote: > >> Hi Peter, > >>> On Jul 11, 2017, at 6:32 AM, Peter Maydell > >>> wrote: > >>> Hi -- this test seems to intermittently fail: > >>>

Re: [Qemu-devel] [PATCH] slirp: fork_exec(): Don't close() a negative number in fork_exec()

2017-07-11 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > [cc'd Eric as the sort of person > > On 11 July 2017 at 17:29, Dr. David Alan Gilbert wrote: > > * Peter Maydell (peter.mayd...@linaro.org) wrote: > >> In a fork_exec() error path we try to closesocket(s) when s might > >> be a negative number b

Re: [Qemu-devel] [PATCH v9 6/9] qcow2: add bdrv_measure() support

2017-07-11 Thread Eric Blake
On 07/05/2017 07:57 AM, Stefan Hajnoczi wrote: > Use qcow2_calc_prealloc_size() to get the required file size. > > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Alberto Garcia > --- > +for (sector_num = 0; > + sector_num < ssize / BDRV_SECTOR_SIZE; > +

Re: [Qemu-devel] [PATCH v9 6/9] qcow2: add bdrv_measure() support

2017-07-11 Thread Eric Blake
On 07/05/2017 07:57 AM, Stefan Hajnoczi wrote: > Use qcow2_calc_prealloc_size() to get the required file size. > > Signed-off-by: Stefan Hajnoczi > Reviewed-by: Alberto Garcia > --- > > +static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState > *in_bs, > +} else { >

[Qemu-devel] [PATCH] tcg: move atomic_template.h to accel/tcg/

2017-07-11 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- same as Thomas previous patch. this file had no entry in MAINTAINERS. atomic_template.h => accel/tcg/atomic_template.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename atomic_template.h => accel/tcg/atomic_template.h (100%) diff --git a/atom

Re: [Qemu-devel] [Qemu-block] [PATCH 15/35] backup: mark coroutine_fn

2017-07-11 Thread Stefan Hajnoczi
On Wed, Jul 05, 2017 at 12:03:26AM +0200, Marc-André Lureau wrote: > Signed-off-by: Marc-André Lureau > --- > include/block/block_backup.h | 4 ++-- > block/backup.c | 9 ++--- > 2 files changed, 8 insertions(+), 5 deletions(-) Reviewed-by: Stefan Hajnoczi signature.asc Desc

Re: [Qemu-devel] [PATCH v2] block: fix leaks in bdrv_open_driver()

2017-07-11 Thread Manos Pitsidianakis
On Tue, Jul 11, 2017 at 05:16:17PM +0200, Kevin Wolf wrote: Am 01.07.2017 um 17:39 hat Manos Pitsidianakis geschrieben: bdrv_open_driver() is called in two places, bdrv_new_open_driver() and bdrv_open_common(). In the latter, failure cleanup in is in its caller, bdrv_open_inherit(), which unrefs

Re: [Qemu-devel] [PATCH 2/2] slirp: Handle error returns from sosendoob()

2017-07-11 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > sosendoob() can return a failure code, but all its callers ignore it. > This is OK in sbappend(), as the comment there states -- we will try > again later in sowrite(). Add a (void) cast to tell Coverity so. > In sowrite() we do need to check the

Re: [Qemu-devel] [PATCH v4 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > Now that bdrv_truncate is passed to bs->file by default, remove the > callback from block/blkdebug.c and set is_filter to true. This also automatically gives blkdebug access to bdrv_probe_blocksizes bdrv_probe_geometry bdrv_has_zero_init bdrv_g

[Qemu-devel] [PATCH v3.5 2/8] target/s390x: Implement CONVERT UNICODE insns

2017-07-11 Thread Richard Henderson
Signed-off-by: Richard Henderson --- v3.5: Added even register checks in the translator [thuth]. --- target/s390x/helper.h | 6 + target/s390x/mem_helper.c | 310 + target/s390x/translate.c | 51 target/s390x/insn-data.def | 13 ++

Re: [Qemu-devel] [PATCH v12 04/27] target: [tcg] Add generic translation framework

2017-07-11 Thread Alex Bennée
Lluís Vilanova writes: > Signed-off-by: Lluís Vilanova > --- > accel/tcg/Makefile.objs |1 > accel/tcg/translator.c| 152 > + > include/exec/gen-icount.h |2 - > include/exec/translator.h | 99 + > 4 file

Re: [Qemu-devel] should we update QEMU's u-boot submodule and binary?

2017-07-11 Thread Alexander Graf
On 11.07.17 19:43, Peter Maydell wrote: Hi; I just noticed that our u-boot submodule is still stuck on a commit from 2014 when it was first added to QEMU. Should we move this forward to some more recent u-boot release? I think we only use this for our ppc e500 rom... It probably makes sense

Re: [Qemu-devel] [PATCH v3 0/6] arm: fixes for eret, isb and DISAS_UPDATE handling

2017-07-11 Thread Richard Henderson
On 07/11/2017 07:59 AM, Alex Bennée wrote: Hopefully there isn't anything else that needs fixing so I guess the next question is who's tree should this go through? I'm happy with this going through the arm tree. r~

Re: [Qemu-devel] [PATCH v3 1/6] include/exec/exec-all: document common exit conditions

2017-07-11 Thread Richard Henderson
On 07/11/2017 07:59 AM, Alex Bennée wrote: As a precursor to later patches attempt to come up with a more concrete wording for what each of the common exit cases would be. CC: Emilio G. Cota CC: Richard Henderson CC: Lluís Vilanova Signed-off-by: Alex Bennée --- include/exec/exec-all.h | 29 ++

Re: [Qemu-devel] [PATCH v3 5/6] target/arm: use gen_goto_tb for ISB handling

2017-07-11 Thread Richard Henderson
On 07/11/2017 07:59 AM, Alex Bennée wrote: While an ISB will ensure any raised IRQs happen on the next instruction it doesn't cause any to get raised by itself. We can therefor use a simple tb exit for ISB instructions and rely on the exit_request check at the top of each TB to deal with exiting

Re: [Qemu-devel] [PATCH v3 4/6] target/arm/translate: ensure gen_goto_tb sets exit flags

2017-07-11 Thread Richard Henderson
On 07/11/2017 07:59 AM, Alex Bennée wrote: if (use_goto_tb(s, dest)) { tcg_gen_goto_tb(n); gen_set_pc_im(s, dest); tcg_gen_exit_tb((uintptr_t)s->tb + n); +s->is_jmp = DISAS_TB_JUMP; } else { gen_set_pc_im(s, dest); gen_goto_ptr

Re: [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > This patch add shrinking of the image file for qcow2. As a result, this allows > us to reduce the virtual image size and free up space on the disk without > copying the image. Image can be fragmented and shrink is done by punching > holes > in the image

[Qemu-devel] [PATCH v15] migration: spapr: migrate pending_events of spapr state

2017-07-11 Thread Daniel Henrique Barboza
In racing situations between hotplug events and migration operation, a rtas hotplug event could have not yet be delivered to the source guest when migration is started. In this case the pending_events of spapr state need be transmitted to the target so that the hotplug event can be finished on the

[Qemu-devel] [PATCH v15] migration: spapr: migrate pending_events of spapr state

2017-07-11 Thread Daniel Henrique Barboza
v15: - changed default endianess of sPAPREventLogEntry to native - write the header fields and the extended_log directly in the guest memory v14: - several changes made in spapr_events.c to allow for a minimal VMSD to be migrated. Please check the commit message of the patch for more information.

Re: [Qemu-devel] [PATCH v4 4/4] qemu-iotests: add shrinking image test

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > Signed-off-by: Pavel Butsykin > --- > tests/qemu-iotests/163 | 170 > + > tests/qemu-iotests/163.out | 5 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 176 insertions(+) > create mode 10

Re: [Qemu-devel] [PATCH 1/2] slirp: Handle error returns from slirp_send() in sosendoob()

2017-07-11 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > The code in sosendoob() assumes that slirp_send() always > succeeds, but it might return an OS error code (for instance > if the other end has disconnected). Catch these and return > the caller either -1 on error or the number of urgent bytes > ac

Re: [Qemu-devel] [PATCHv7 5/6] fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers

2017-07-11 Thread Mark Cave-Ayland
On 10/07/17 18:38, Eduardo Habkost wrote: > On Mon, Jul 10, 2017 at 05:23:36PM +0200, Igor Mammedov wrote: >> On Mon, 10 Jul 2017 11:53:31 -0300 >> Eduardo Habkost wrote: >> >>> On Mon, Jul 10, 2017 at 10:01:47AM +0200, Igor Mammedov wrote: On Fri, 7 Jul 2017 17:20:25 +0100 Mark Cave-Ay

[Qemu-devel] [PATCH v3 0/6] arm: fixes for eret, isb and DISAS_UPDATE handling

2017-07-11 Thread Alex Bennée
Hi, Hopefully this is the final iteration after: https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg02452.html The only major change is fixing up gen_goto_tb for arm and then using that in both a32 and a64 for the ISB changes. Other than that I've applied the review tags. Hopefully ther

[Qemu-devel] [PATCH v3 6/6] target/arm: use DISAS_EXIT for eret handling

2017-07-11 Thread Alex Bennée
Previously DISAS_JUMP did ensure this but with the optimisation of 8a6b28c7 (optimize indirect branches) we might not leave the loop. This means if any pending interrupts are cleared by changing IRQ flags we might never get around to servicing them. You usually notice this by seeing the lookup_tb_p

[Qemu-devel] [PATCH v3 4/6] target/arm/translate: ensure gen_goto_tb sets exit flags

2017-07-11 Thread Alex Bennée
As the gen_goto_tb function can do both static and dynamic jumps it should also set the is_jmp field. This matches the behaviour of the a64 code. Signed-off-by: Alex Bennée --- target/arm/translate.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/arm/translate.c

[Qemu-devel] [PATCH v3 5/6] target/arm: use gen_goto_tb for ISB handling

2017-07-11 Thread Alex Bennée
While an ISB will ensure any raised IRQs happen on the next instruction it doesn't cause any to get raised by itself. We can therefor use a simple tb exit for ISB instructions and rely on the exit_request check at the top of each TB to deal with exiting if needed. Signed-off-by: Alex Bennée ---

[Qemu-devel] [PATCH v3 2/6] target/arm/translate: make DISAS_UPDATE match declared semantics

2017-07-11 Thread Alex Bennée
DISAS_UPDATE should be used when the wider CPU state other than just the PC has been updated and we should therefor exit the TCG runtime and return to the main execution loop rather assuming DISAS_JUMP would do that. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/trans

[Qemu-devel] [PATCH v3 3/6] target/arm/translate.h: expand comment on DISAS_EXIT

2017-07-11 Thread Alex Bennée
We already have an exit condition, DISAS_UPDATE which will exit the run-loop. Expand on the difference with DISAS_EXIT in the comments. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- target/arm/translate.h | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ta

[Qemu-devel] [PATCH v3 1/6] include/exec/exec-all: document common exit conditions

2017-07-11 Thread Alex Bennée
As a precursor to later patches attempt to come up with a more concrete wording for what each of the common exit cases would be. CC: Emilio G. Cota CC: Richard Henderson CC: Lluís Vilanova Signed-off-by: Alex Bennée --- include/exec/exec-all.h | 29 ++--- 1 file change

Re: [Qemu-devel] [PATCH 0/3] pci: allow PCI bus slots to be marked as reserved

2017-07-11 Thread Mark Cave-Ayland
On 11/07/17 16:57, Michael S. Tsirkin wrote: > On Tue, Jul 11, 2017 at 06:51:50PM +0300, Marcel Apfelbaum wrote: >> On 11/07/2017 18:31, Michael S. Tsirkin wrote: >>> On Fri, Jul 07, 2017 at 08:43:59AM +0100, Mark Cave-Ayland wrote: For some machines it is impossible to plug devices into a pa

Re: [Qemu-devel] [Qemu-arm] [PATCH 1/7] hw/arm/mps2: Implement skeleton mps2-an385 and mps2-an511 board models

2017-07-11 Thread Philippe Mathieu-Daudé
On 07/11/2017 01:35 PM, Peter Maydell wrote: On 11 July 2017 at 15:33, Alistair Francis wrote: On Tue, Jul 11, 2017 at 1:17 PM, Peter Maydell wrote: [...] +create_unimplemented_device("RESERVED 4", 0x4003, 0x001D); +create_unimplemented_device("Ethernet", 0x4020, 0x001000

Re: [Qemu-devel] [Qemu-arm] [PATCH 2/7] hw/char/cmsdk-apb-uart.c: Implement CMSDK APB UART

2017-07-11 Thread Philippe Mathieu-Daudé
On 07/11/2017 12:12 PM, Alistair Francis wrote: On Tue, Jul 11, 2017 at 1:17 PM, Peter Maydell wrote: [...] +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "qapi/error.h" +#include "trace.h" +#include "hw/sysbus.h" +#include "hw/registerfields.h" [...] +REG32(DATA, 0) +REG32(STATE,

Re: [Qemu-devel] [PATCH v3 8/8] error: Add a 'error: ' prefix to error_report()

2017-07-11 Thread Max Reitz
On 2017-07-11 14:07, Alistair Francis wrote: > As we don't regard error messages as a stable API the let's add a > 'error: ' prefix to the original error_report() messages. > > Signed-off-by: Alistair Francis > --- > > util/qemu-error.c | 1 + > 1 file changed, 1 insertion(+) This breaks quite

[Qemu-devel] should we update QEMU's u-boot submodule and binary?

2017-07-11 Thread Peter Maydell
Hi; I just noticed that our u-boot submodule is still stuck on a commit from 2014 when it was first added to QEMU. Should we move this forward to some more recent u-boot release? I think we only use this for our ppc e500 rom... thanks -- PMM

Re: [Qemu-devel] [PATCH 2/3] qdev: support properties which don't set a default value

2017-07-11 Thread Peter Maydell
On 11 July 2017 at 18:15, Marc-André Lureau wrote: >> @@ -793,7 +793,7 @@ void qdev_property_add_static(DeviceState *dev, Property >> *prop, >> prop->info->description, >> &error_abort); >> >> -if (prop->info->set_defaul

Re: [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions

2017-07-11 Thread Peter Maydell
On 11 July 2017 at 18:18, Marc-André Lureau wrote: > - Original Message - >> The Cortex-M3 and M4 CPUs always have 8 PMSA MPU regions (this isn't >> a configurable option for the hardware). Make the default value of >> the pmsav7-dregion property be set per-cpu, so we don't need to have >

Re: [Qemu-devel] [PATCH] slirp: fork_exec(): Don't close() a negative number in fork_exec()

2017-07-11 Thread Peter Maydell
[cc'd Eric as the sort of person On 11 July 2017 at 17:29, Dr. David Alan Gilbert wrote: > * Peter Maydell (peter.mayd...@linaro.org) wrote: >> In a fork_exec() error path we try to closesocket(s) when s might >> be a negative number because the thing that failed was the >> qemu_socket() call. Ad

Re: [Qemu-devel] [PATCH v12 04/27] target: [tcg] Add generic translation framework

2017-07-11 Thread Richard Henderson
On 07/11/2017 06:40 AM, Lluís Vilanova wrote: Since other hooks can set db->is_jmp and return values (breakpoint_check), I'll stick with db->is_jmp instead. Then tb_start can return max_insns, and generic code can refine it with checks like single-stepping. No, you misunderstand. For SH4 I nee

Re: [Qemu-devel] [PATCH v4 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > The following functions fail if bs->drv is a filter and does not > implement them: > > bdrv_probe_blocksizes > bdrv_probe_geometry > bdrv_truncate > bdrv_has_zero_init > bdrv_get_info > > Instead, the call should be passed to bs->file if it exi

Re: [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions

2017-07-11 Thread Marc-André Lureau
hi - Original Message - > On 11 July 2017 at 18:18, Marc-André Lureau > wrote: > > - Original Message - > >> The Cortex-M3 and M4 CPUs always have 8 PMSA MPU regions (this isn't > >> a configurable option for the hardware). Make the default value of > >> the pmsav7-dregion proper

Re: [Qemu-devel] [PATCH v4 3/4] qcow2: add shrink image support

2017-07-11 Thread Max Reitz
On 2017-07-11 14:40, Pavel Butsykin wrote: > This patch add shrinking of the image file for qcow2. As a result, this allows > us to reduce the virtual image size and free up space on the disk without > copying the image. Image can be fragmented and shrink is done by punching > holes > in the image

Re: [Qemu-devel] [PATCH 3/3] target/arm: Make Cortex-M3 and M4 default to 8 PMSA regions

2017-07-11 Thread Marc-André Lureau
Hi - Original Message - > The Cortex-M3 and M4 CPUs always have 8 PMSA MPU regions (this isn't > a configurable option for the hardware). Make the default value of > the pmsav7-dregion property be set per-cpu, so we don't need to have > every user of these CPUs set it manually. (The exis

Re: [Qemu-devel] [PULL 19/21] tests: Add unit tests for the VM Generation ID feature

2017-07-11 Thread Peter Maydell
On 11 July 2017 at 16:22, Peter Maydell wrote: > On 11 July 2017 at 16:07, Ben Warren wrote: >> Hi Peter, >>> On Jul 11, 2017, at 6:32 AM, Peter Maydell wrote: >>> Hi -- this test seems to intermittently fail: >>> >>> TEST: tests/vmgenid-test... (pid=15466) >>> /i386/vmgenid/vmgenid/set-guid:

Re: [Qemu-devel] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-11 Thread Eric Blake
On 07/11/2017 11:37 AM, Manos Pitsidianakis wrote: > This function is not used anywhere, so remove it. > Might be interesting to figure out when it WAS last used. If I grepped correctly, it was commit 21fcf360 back in May 2012? > Signed-off-by: Manos Pitsidianakis > --- > block.c

Re: [Qemu-devel] [PATCH 2/3] qdev: support properties which don't set a default value

2017-07-11 Thread Marc-André Lureau
Hi - Original Message - > In some situations it's useful to have a qdev property which doesn't > automatically set its default value when qdev_property_add_static is > called (for instance when the default value is not constant). > > Support this by adding a flag to the Property struct in

Re: [Qemu-devel] [PATCH 1/3] qdev-properties.h: Explicitly set the default value for arraylen properties

2017-07-11 Thread Marc-André Lureau
- Original Message - > In DEFINE_PROP_ARRAY, because we use a PropertyInfo (qdev_prop_arraylen) > which has a .set_default_value member we will set the field to a default > value. That default value will be zero, by the C rule that struct > initialization sets unmentioned members to zero

Re: [Qemu-devel] [PATCH v4 09/17] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset

2017-07-11 Thread Eric Blake
On 07/03/2017 10:10 AM, Eric Blake wrote: > 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. > > Signed-off-

Re: [Qemu-devel] [PATCH v2 4/5] target/arm: use DISAS_JUMP for ISB handling

2017-07-11 Thread Richard Henderson
On 07/10/2017 10:27 PM, Alex Bennée wrote: Richard Henderson writes: On 07/10/2017 09:21 AM, Alex Bennée wrote: -s->is_jmp = DISAS_UPDATE; +gen_a64_set_pc_im(s->pc); +s->is_jmp = DISAS_JUMP; Better would be gen_goto_tb. The destination is known, so there's no need

Re: [Qemu-devel] [PATCH v3 3/8] Convert error_report() to warn_report()

2017-07-11 Thread Max Reitz
On 2017-07-11 14:07, Alistair Francis wrote: > Convert all uses of error_report("warning:"... to use warn_report() > instead. This helps standardise on a single method of printing warnings > to the user. > > All of the warnings where changed using these two commands: > find ./* -type f -exec s

[Qemu-devel] [PATCH v4 1/4] block: pass bdrv_* methods to bs->file by default in block filters

2017-07-11 Thread Manos Pitsidianakis
The following functions fail if bs->drv is a filter and does not implement them: bdrv_probe_blocksizes bdrv_probe_geometry bdrv_truncate bdrv_has_zero_init bdrv_get_info Instead, the call should be passed to bs->file if it exists, to allow filter drivers to support those methods without implement

[Qemu-devel] [PATCH] block: check BlockDriverState object before dereference

2017-07-11 Thread P J P
From: Prasad J Pandit When processing ATA_CACHE_FLUSH ide controller command, BlockDriverState object could be null. Add check to avoid null pointer dereference. Reported-by: Kieron Shorrock Signed-off-by: Prasad J Pandit --- block/block-backend.c | 9 +++-- 1 file changed, 7 insertions(+

Re: [Qemu-devel] [PATCH 2/7] hw/char/cmsdk-apb-uart.c: Implement CMSDK APB UART

2017-07-11 Thread Peter Maydell
On 11 July 2017 at 16:40, Alistair Francis wrote: > On Tue, Jul 11, 2017 at 5:33 PM, Peter Maydell > wrote: >> On 11 July 2017 at 16:12, Alistair Francis wrote: >>> On Tue, Jul 11, 2017 at 1:17 PM, Peter Maydell >>> wrote: Implement a model of the simple "APB UART" provided in the C

[Qemu-devel] [PATCH v4 4/4] block: add default implementations for bdrv_co_get_block_status()

2017-07-11 Thread Manos Pitsidianakis
bdrv_co_get_block_status_from_file() and bdrv_co_get_block_status_from_backing() set *file to bs->file and bs->backing respectively, so that bdrv_co_get_block_status() can recurse to them. Future block drivers won't have to duplicate code to implement this. Reviewed-by: Fam Zheng Reviewed-by: Eri

[Qemu-devel] [PATCH v4 3/4] block: remove bdrv_truncate callback in blkdebug

2017-07-11 Thread Manos Pitsidianakis
Now that bdrv_truncate is passed to bs->file by default, remove the callback from block/blkdebug.c and set is_filter to true. Signed-off-by: Manos Pitsidianakis --- block/blkdebug.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c inde

Re: [Qemu-devel] [PATCH 1/7] hw/arm/mps2: Implement skeleton mps2-an385 and mps2-an511 board models

2017-07-11 Thread Peter Maydell
On 11 July 2017 at 15:33, Alistair Francis wrote: > On Tue, Jul 11, 2017 at 1:17 PM, Peter Maydell > wrote: >> Model the ARM MPS2/MPS2+ FPGA based development board. >> >> The MPS2 and MPS2+ dev boards are FPGA based (the 2+ has a bigger >> FPGA but is otherwise the same as the 2). Since the CPU

[Qemu-devel] [PATCH v4 0/4] block: Block driver callbacks fixes

2017-07-11 Thread Manos Pitsidianakis
This series makes implementing some of the bdrv_* callbacks easier for block filters by passing requests to bs->file if bs->drv doesn't implement it instead of failing, and adding default bdrv_co_get_block_status() implementations. This is based against Kevin Wolf's block branch, commit da4bd74d24

[Qemu-devel] [PATCH v4 2/4] block: remove bdrv_media_changed

2017-07-11 Thread Manos Pitsidianakis
This function is not used anywhere, so remove it. Signed-off-by: Manos Pitsidianakis --- block.c | 14 -- block/raw-format.c| 6 -- include/block/block.h | 1 - include/block/block_int.h | 1 - 4 files changed, 22 deletions(-) diff --git a/block.

Re: [Qemu-devel] [PATCH v12 04/27] target: [tcg] Add generic translation framework

2017-07-11 Thread Lluís Vilanova
Richard Henderson writes: > On 07/07/2017 01:56 AM, Lluís Vilanova wrote: [...] >> + >> +/* Instruction counting */ >> +max_insns = db->tb->cflags & CF_COUNT_MASK; >> +if (max_insns == 0) { >> +max_insns = CF_COUNT_MASK; >> +} >> +if (max_insns > TCG_MAX_INSNS) { >> +

Re: [Qemu-devel] [RFC PATCH 1/3] configure: disable Xen PCI Passthrough on !x86 archs

2017-07-11 Thread Paolo Bonzini
On 11/07/2017 18:26, Alex Bennée wrote: >> It seems our minds crossed at the same time since Alex/Pablo fixed it >> and got merged in master as b5ed2e11ef39 "build: disable Xen on ARM" >> so this patch is no more necessary. >> >> Alex/Pablo, any thought on patch 2 regarding xen-mapcache.h? > > Pas

Re: [Qemu-devel] [RFC PATCH 1/3] configure: disable Xen PCI Passthrough on !x86 archs

2017-07-11 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > It seems our minds crossed at the same time since Alex/Pablo fixed it > and got merged in master as b5ed2e11ef39 "build: disable Xen on ARM" > so this patch is no more necessary. > > Alex/Pablo, any thought on patch 2 regarding xen-mapcache.h? Pass, I know littl

Re: [Qemu-devel] [PATCH] slirp: fork_exec(): Don't close() a negative number in fork_exec()

2017-07-11 Thread Dr. David Alan Gilbert
* Peter Maydell (peter.mayd...@linaro.org) wrote: > In a fork_exec() error path we try to closesocket(s) when s might > be a negative number because the thing that failed was the > qemu_socket() call. Add a guard so we don't do this. > > (Spotted by Coverity: CID 1005727 issue 1 of 2.) > > Signed

[Qemu-devel] [PULL 81/85] block/qcow2: Add qcow2_refcount_area()

2017-07-11 Thread Max Reitz
This function creates a collection of self-describing refcount structures (including a new refcount table) at the end of a qcow2 image file. Optionally, these structures can also describe a number of additional clusters beyond themselves; this will be important for preallocated truncation, which wi

[Qemu-devel] [PULL 80/85] block/qcow2: Metadata preallocation for truncate

2017-07-11 Thread Max Reitz
We can support PREALLOC_MODE_METADATA by invoking preallocate() in qcow2_truncate(). Signed-off-by: Max Reitz Message-id: 20170613202107.10125-12-mre...@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/qcow2.c | 33 +++-- 1 file changed, 31

[Qemu-devel] [PULL 79/85] block/qcow2: Lock s->lock in preallocate()

2017-07-11 Thread Max Reitz
preallocate() is and will be called only from places that do not otherwise need to lock s->lock: Currently that is qcow2_create2(), as of a future patch it will be called from qcow2_truncate(), too. It therefore makes sense to move locking that mutex into preallocate() itself. Signed-off-by: Max

[Qemu-devel] [PULL 77/85] block/file-posix: Preallocation for truncate

2017-07-11 Thread Max Reitz
By using raw_regular_truncate() in raw_truncate(), we can now easily support preallocation. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-9-mre...@redhat.com Signed-off-by: Max Reitz --- block/file-posix.c | 22 ++ 1 file changed, 10

[Qemu-devel] [PULL 78/85] block/qcow2: Generalize preallocate()

2017-07-11 Thread Max Reitz
This patch adds two new parameters to the preallocate() function so we will be able to use it not just for preallocating a new image but also for preallocated image growth. The offset parameter allows the caller to specify a virtual offset from which to start preallocating. For newly created image

[Qemu-devel] [PULL 75/85] block/file-posix: Extract raw_regular_truncate()

2017-07-11 Thread Max Reitz
This functionality is part of raw_create() which we will be able to reuse nicely in raw_truncate(). Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Message-id: 20170613202107.10125-7-mre...@redhat.com Signed-off-by: Max Reitz --- block/file-posix.c |

[Qemu-devel] [PULL 73/85] qemu-img: Expose PreallocMode for resizing

2017-07-11 Thread Max Reitz
Add a --preallocation command line option to qemu-img resize which can be used to set the PreallocMode parameter of blk_truncate(). While touching this code, fix the fact that we did not handle errors returned by blk_getlength(). Signed-off-by: Max Reitz Message-id: 20170613202107.10125-5-mre...

Re: [Qemu-devel] [PULL 00/17] ppc-for-2.10 queue 20170711

2017-07-11 Thread Peter Maydell
ble in the git repository at: > > git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170711 > > for you to fetch changes up to b87680427e8a3ff682f66514e99a8344e7437247: > > spapr: populate device tree depending on XIV

[Qemu-devel] [PULL 69/85] iotests: add test 178 for qemu-img measure

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-10-stefa...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/178 | 170 +++ tests/qemu-iotests/178.out.qcow2 | 286 +

[Qemu-devel] [PULL 74/85] block/file-posix: Small fixes in raw_create()

2017-07-11 Thread Max Reitz
Variables should be declared at the start of a block, and if a certain parameter value is not supported it may be better to return -ENOTSUP instead of -EINVAL. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Message-id: 20170613202107.10125-6-mre...@red

[Qemu-devel] [PULL 85/85] iotests: Add preallocated growth test for qcow2

2017-07-11 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-17-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/125 | 130 +++ tests/qemu-iotests/125.out | 386 + tests/qemu-iotests/group |

[Qemu-devel] [PULL 76/85] block/file-posix: Generalize raw_regular_truncate

2017-07-11 Thread Max Reitz
Currently, raw_regular_truncate() is intended for setting the size of a newly created file. However, we also want to use it for truncating an existing file in which case only the newly added space (when growing) should be preallocated. This also means that if resizing failed, we should try to rest

[Qemu-devel] [PULL 63/85] qcow2: extract preallocation calculation function

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Calculating the preallocated image size will be needed to implement .bdrv_measure(). Extract the code out into a separate function. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-4-stefa...@redhat.com Signed-off-by: Max Reitz

[Qemu-devel] [PULL 70/85] block: Add PreallocMode to BD.bdrv_truncate()

2017-07-11 Thread Max Reitz
Add a PreallocMode parameter to the bdrv_truncate() function implemented by each block driver. Currently, we always pass PREALLOC_MODE_OFF and no driver accepts anything else. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-2-mre...@redhat.com Signed-off-by

[Qemu-devel] [PULL 83/85] block/qcow2: falloc/full preallocating growth

2017-07-11 Thread Max Reitz
Implement the preallocation modes falloc and full for growing qcow2 images. Signed-off-by: Max Reitz Message-id: 20170613202107.10125-15-mre...@redhat.com Reviewed-by: Stefan Hajnoczi Signed-off-by: Max Reitz --- block/qcow2.h | 5 +++ block/qcow2-refcount.c | 12 ++ block/qcow

[Qemu-devel] [PULL 60/85] tests: Avoid non-portable 'echo -ARG'

2017-07-11 Thread Max Reitz
From: Eric Blake POSIX says that backslashes in the arguments to 'echo', as well as any use of 'echo -n' and 'echo -e', are non-portable; it recommends people should favor 'printf' instead. This is definitely true where we do not control which shell is running (such as in makefile snippets or in

[Qemu-devel] [PULL 65/85] qcow2: extract image creation option parsing

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi The image creation options parsed by qcow2_create() are also needed to implement .bdrv_measure(). Extract the parsing code, including input validation. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-6-stefa...@redhat.com Signed

[Qemu-devel] [PULL 84/85] iotests: Add preallocated resize test for raw

2017-07-11 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-16-mre...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/106 | 92 ++ tests/qemu-iotests/106.out | 50 + tests/qemu-iotests/

[Qemu-devel] [PULL 57/85] iotests: chown LUKS device before qemu-io launches

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" On some distros, whenever you close a block device file descriptor there is a udev rule that resets the file permissions. This can race with the test script when we run qemu-io multiple times against the same block device. Occasionally the second qemu-io invocation will

[Qemu-devel] [PULL 61/85] block: add bdrv_measure() API

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi bdrv_measure() provides a conservative maximum for the size of a new image. This information is handy if storage needs to be allocated (e.g. a SAN or an LVM volume) ahead of time. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-

[Qemu-devel] [PULL 82/85] block/qcow2: Rename "fail_block" to just "fail"

2017-07-11 Thread Max Reitz
Now alloc_refcount_block() only contains a single fail label, so it makes more sense to just name it "fail" instead of "fail_block". Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-14-mre...@redhat.com Signed-off-by: Max Reitz --- block/qcow2-refcount.c |

[Qemu-devel] [PULL 56/85] iotests: add more LUKS hash combination tests

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" Add tests for sha224, sha512, sha384 and ripemd160 hash algorithms. Reviewed-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrange Message-id: 20170626123510.20134-5-berra...@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/149 | 1

[Qemu-devel] [PULL 67/85] qemu-img: add measure subcommand

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi The measure subcommand calculates the size required by a new image file. This can be used by users or management tools that need to allocate space on an LVM volume, SAN LUN, etc before creating or converting an image file. Suggested-by: Maor Lipchuk Signed-off-by: Stefan H

[Qemu-devel] [PULL 55/85] iotests: reduce PBKDF iterations when testing LUKS

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" By default the PBKDF algorithm used with LUKS is tuned based on the number of iterations to produce 1 second of running time. This makes running the I/O test with the LUKS format orders of magnitude slower than with qcow2/raw formats. When creating LUKS images, set the

[Qemu-devel] [PULL 58/85] iotests: Use absolute paths for executables

2017-07-11 Thread Max Reitz
A user may specify a relative path for accessing qemu, qemu-img, etc. through environment variables ($QEMU_PROG and friends) or a symlink. If a test decides to change its working directory, relative paths will cease to work, however. Work around this by making all of the paths to programs that sho

[Qemu-devel] [PULL 68/85] qemu-iotests: support per-format golden output files

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Some tests produce format-dependent output. Either the difference is filtered out and ignored, or the test case is format-specific so we don't need to worry about per-format output differences. There is a third case: the test script is the same for all image formats and th

[Qemu-devel] [PULL 72/85] block: Add PreallocMode to blk_truncate()

2017-07-11 Thread Max Reitz
blk_truncate() itself will pass that value to bdrv_truncate(), and all callers of blk_truncate() just set the parameter to PREALLOC_MODE_OFF for now. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-4-mre...@redhat.com Signed-off-by: Max Reitz --- include/

[Qemu-devel] [PULL 54/85] iotests: fix remainining tests to work with LUKS

2017-07-11 Thread Max Reitz
From: "Daniel P. Berrange" The tests 033, 140, 145 and 157 were all broken when run with LUKS, since they did not correctly use the required image opts args syntax to specify the decryption secret. Further, the 120 test simply does not make sense to run with luks, as the scenario exercised is not

[Qemu-devel] [PULL 52/85] block: release persistent bitmaps on inactivate

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy We should release them here to reload on invalidate cache. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Message-id: 20170628120530.31251-31-vsement...@virtuozzo.com Signed-off-by: Max Reitz --- include/block/dirty-bitmap.h | 1 + bloc

[Qemu-devel] [PULL 66/85] qcow2: add bdrv_measure() support

2017-07-11 Thread Max Reitz
From: Stefan Hajnoczi Use qcow2_calc_prealloc_size() to get the required file size. Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20170705125738.8777-7-stefa...@redhat.com Signed-off-by: Max Reitz --- block/qcow2.c | 137 ++

[Qemu-devel] [PULL 50/85] qcow2: add .bdrv_remove_persistent_dirty_bitmap

2017-07-11 Thread Max Reitz
From: Vladimir Sementsov-Ogievskiy Realize .bdrv_remove_persistent_dirty_bitmap interface. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow Message-id: 20170628120530.31251-29-vsement...@virtuozzo.com Signed-off-by: Max Reitz --- block/qcow2.h

[Qemu-devel] [PULL 71/85] block: Add PreallocMode to bdrv_truncate()

2017-07-11 Thread Max Reitz
For block drivers that just pass a truncate request to the underlying protocol, we can now pass the preallocation mode instead of aborting if it is not PREALLOC_MODE_OFF. Signed-off-by: Max Reitz Reviewed-by: Stefan Hajnoczi Message-id: 20170613202107.10125-3-mre...@redhat.com Signed-off-by: Max

<    1   2   3   4   5   6   >