Re: [Qemu-devel] [PATCH v2 2/3] tests: use QEMU_CACHELINE_SIZE instead of hard-coding it

2017-06-05 Thread Pranith Kumar
On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: > Signed-off-by: Emilio G. Cota Reviewed-by: Pranith Kumar > --- > tests/atomic_add-bench.c | 4 ++-- > tests/qht-bench.c| 2 +- > 2 files changed, 3 insertions(+), 3

Re: [Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-05 Thread Pranith Kumar
On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: > This is a constant used as a hint for padding structs to hopefully avoid > false cache line sharing. > > The constant can be set at configure time by defining QEMU_CACHELINE_SIZE > via --extra-cflags. If not set there, we try

Re: [Qemu-devel] [PATCH v2 3/3] tcg: allocate TB structs before the corresponding translated code

2017-06-05 Thread Pranith Kumar
On Mon, Jun 5, 2017 at 6:49 PM, Emilio G. Cota wrote: > Allocating an arbitrarily-sized array of tbs results in either > (a) a lot of memory wasted or (b) unnecessary flushes of the code > cache when we run out of TB structs in the array. > > An obvious solution would be to just

[Qemu-devel] [PATCH v2 0/1] qemu/migration: fix the migration bug found by qemu-iotests case 068

2017-06-05 Thread QingFeng Hao
Hi all, This patch is to fix the migration bug found by qemu-iotests case 068 and based on upstream master's commit: 199e19ee53: Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging. The bug was introduced by commit "660819b migration: shut src return path

[Qemu-devel] [PATCH v2 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread QingFeng Hao
In load_snapshot, mis->from_src_file is freed twice, the first free is by qemu_fclose, the second is by migration_incoming_state_destroy and it causes Illegal instruction exception. The fix is just to remove the first free. This problem is found by qemu-iotests case 068 since commit "660819b

Re: [Qemu-devel] [PATCH v1 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread QingFeng Hao
在 2017/6/6 11:50, Peter Xu 写道: On Tue, Jun 06, 2017 at 11:38:05AM +0800, QingFeng Hao wrote: 在 2017/6/6 11:03, Peter Xu 写道: On Mon, Jun 05, 2017 at 12:48:51PM +0200, QingFeng Hao wrote: In load_vmstate, mis->from_src_file is freed twice, the first free is by qemu_fclose, the second is by

Re: [Qemu-devel] [PATCH v4 0/4] more blkdebug tweaks

2017-06-05 Thread John Snow
On 06/05/2017 04:38 PM, Eric Blake wrote: > I found a crasher and some odd behavior while rebasing my > bdrv_get_block_status series, so I figured I'd get these things > fixed first. This is based on top of Max's block branch. > > Available as a tag at: > git fetch

Re: [Qemu-devel] [PATCH v1 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread Peter Xu
On Tue, Jun 06, 2017 at 11:38:05AM +0800, QingFeng Hao wrote: > > > 在 2017/6/6 11:03, Peter Xu 写道: > >On Mon, Jun 05, 2017 at 12:48:51PM +0200, QingFeng Hao wrote: > >>In load_vmstate, mis->from_src_file is freed twice, the first free is by > >>qemu_fclose, the second is by

Re: [Qemu-devel] [PATCH v1 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread QingFeng Hao
在 2017/6/6 11:03, Peter Xu 写道: On Mon, Jun 05, 2017 at 12:48:51PM +0200, QingFeng Hao wrote: In load_vmstate, mis->from_src_file is freed twice, the first free is by qemu_fclose, the second is by migration_incoming_state_destroy and it causes Illegal instruction exception. The fix is just to

Re: [Qemu-devel] [PATCH v1] virtio-net: enable configurable tx queue size

2017-06-05 Thread Wei Wang
On 06/05/2017 11:38 PM, Michael S. Tsirkin wrote: On Mon, Jun 05, 2017 at 04:57:29PM +0800, Wei Wang wrote: /* * Calculate the number of bytes up to and including the given 'field' of @@ -57,6 +62,8 @@ static VirtIOFeature feature_sizes[] = { .end = endof(struct virtio_net_config,

Re: [Qemu-devel] [PATCH v1 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread QingFeng Hao
在 2017/6/5 19:08, Dr. David Alan Gilbert 写道: * QingFeng Hao (ha...@linux.vnet.ibm.com) wrote: In load_vmstate, mis->from_src_file is freed twice, the first free is by qemu_fclose, the second is by migration_incoming_state_destroy and it causes Illegal instruction exception. The fix is just to

Re: [Qemu-devel] [PATCH v1 1/1] qemu/migration: fix the double free problem on from_src_file

2017-06-05 Thread Peter Xu
On Mon, Jun 05, 2017 at 12:48:51PM +0200, QingFeng Hao wrote: > In load_vmstate, mis->from_src_file is freed twice, the first free is by > qemu_fclose, the second is by migration_incoming_state_destroy and > it causes Illegal instruction exception. The fix is just to remove the > first free. > >

[Qemu-devel] [PULL 13/17] spapr: Introduce DRC subclasses

2017-06-05 Thread David Gibson
Currently we only have a single QOM type for all DRCs, but lots of places where we switch behaviour based on the DRC's PAPR defined type. This is a poor use of our existing type system. So, instead create QOM subclasses for each PAPR defined DRC type. We also introduce intermediate subclasses

Re: [Qemu-devel] [PATCH 0/7] KVM: MMU: fast write protect

2017-06-05 Thread Xiao Guangrong
On 06/05/2017 03:36 PM, Jay Zhou wrote: /* enable ucontrol for s390 */ struct kvm_s390_ucas_mapping { diff --git a/memory.c b/memory.c index 4c95aaf..b836675 100644 --- a/memory.c +++ b/memory.c @@ -809,6 +809,13 @@ static void address_space_update_ioeventfds(AddressSpace *as)

[Qemu-devel] [PULL 06/17] spapr: Make DRC get_index and get_type methods into plain functions

2017-06-05 Thread David Gibson
These two methods only have one implementation, and the spec they're implementing means any other implementation is unlikely, verging on impossible. So replace them with simple functions. Signed-off-by: David Gibson Reviewed-by: Laurent Vivier

[Qemu-devel] [PULL 11/17] spapr: Allow boot from vhost-*-scsi backends

2017-06-05 Thread David Gibson
From: Felipe Franciosi The current implementation of spapr_get_fw_dev_path() doesn't take into consideration vhost-*-scsi devices. This makes said devices unbootable on PPC as SLOF is unable to work out the path to scan boot disks. This makes VMs bootable on spapr when using

[Qemu-devel] [PULL 05/17] spapr: Abolish DRC set_configured method

2017-06-05 Thread David Gibson
DRConnectorClass has a set_configured method, however: * There is only one implementation, and only ever likely to be one * There's exactly one caller, and that's (now) local * The implementation is very straightforward So abolish the method entirely, and just open-code what we need.

[Qemu-devel] [PULL 17/17] spapr: Remove some non-useful properties on DRC objects

2017-06-05 Thread David Gibson
* 'connector_type' is easily derived from the 'index' property, so there's no point to it (it's also implicit in the QOM type of the DRC) * 'isolation-state', 'indicator-state' and 'allocation-state' are part of the transaction between qemu and guest during PAPR hotplug operations, and

[Qemu-devel] [PULL 08/17] target/ppc: Fixup set_spr error in h_register_process_table

2017-06-05 Thread David Gibson
From: Suraj Jitindar Singh set_spr is used in the function h_register_process_table() to update the LPCR_GTSE and LPCR_UPRT values based on the flags passed by the guest. The set_spr function takes the last two arguments mask and value used to mask and set the value of

[Qemu-devel] [PULL 09/17] spapr_nvram: Check return value from blk_getlength()

2017-06-05 Thread David Gibson
From: Peter Maydell The blk_getlength() function can return an error value if the image size cannot be determined. Check for this rather than ploughing on and trying to g_malloc0() a negative number. (Spotted by Coverity, CID 1288484.) Signed-off-by: Peter Maydell

[Qemu-devel] [PULL 16/17] spapr: Eliminate spapr_drc_get_type_str()

2017-06-05 Thread David Gibson
This function was used in generating the device tree. However, now that we have different QOM types for different DRC types we can easily store the information we need in the class structure and avoid this specialized lookup function. Signed-off-by: David Gibson

[Qemu-devel] [PULL 03/17] spapr: Move DRC RTAS calls into spapr_drc.c

2017-06-05 Thread David Gibson
Currently implementations of the RTAS calls related to DRCs are in spapr_rtas.c. They belong better in spapr_drc.c - that way they're closer to related code, and we'll be able to make some more things local. spapr_rtas.c was intended to contain the RTAS infrastructure and core calls that don't

[Qemu-devel] [PULL 12/17] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs

2017-06-05 Thread David Gibson
From: Greg Kurz As explained in commit 5c0139a8c2f0 ("spapr: fix default DRC state for coldplugged LMBs"), guests expect cold-plugged LMBs to be pre-allocated and unisolated. The same goes for cold-plugged CPUs. While here, let's convert g_assert(false) to the better self

[Qemu-devel] [PULL 14/17] spapr: Clean up spapr_dr_connector_by_*()

2017-06-05 Thread David Gibson
* Change names to something less ludicrously verbose * Now that we have QOM subclasses for the different DRC types, use a QOM typename instead of a PAPR type value parameter The latter allows removal of the get_type_shift() helper. Signed-off-by: David Gibson

[Qemu-devel] [PULL 04/17] spapr: Abolish DRC get_fdt method

2017-06-05 Thread David Gibson
The DRConnectorClass includes a get_fdt method. However * There's only one implementation, and there's only likely to ever be one * Both callers are local to spapr_drc * Each caller only uses one half of the actual implementation So abolish get_fdt() entirely, and just open-code what we

[Qemu-devel] [PULL 07/17] target-ppc: Fix openpic timer read register offset

2017-06-05 Thread David Gibson
From: Aaron Larson openpic_tmr_read() is incorrectly computing register offset of the TCCR, TBCR, TVPR, and TDR registers when accessing the open pic timer registers. Specifically the offset of timer registers for openpic_tmr_read() is not accounting for the timer frequency

[Qemu-devel] [PULL 10/17] ppc/pnv: check the return value of fdt_setprop()

2017-06-05 Thread David Gibson
From: Cédric Le Goater Signed-off-by: Cédric Le Goater [dwg: Correct typo in commit message] Signed-off-by: David Gibson --- hw/ppc/pnv.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv.c

[Qemu-devel] [PULL 15/17] spapr: Move configure-connector state into DRC

2017-06-05 Thread David Gibson
Currently the sPAPRMachineState contains a list of sPAPRConfigureConnector structures which store intermediate state for the ibm,configure-connector RTAS call. This was an attempt to separate this state from the core of the DRC state. However the configure connector process is intimately tied to

[Qemu-devel] [PULL 01/17] migration: remove register_savevm()

2017-06-05 Thread David Gibson
From: Laurent Vivier We can replace the four remaining calls of register_savevm() by calls to register_savevm_live(). So we can remove the function and as we don't allocate anymore the ops pointer with g_new0() we don't have to free it then. Signed-off-by: Laurent Vivier

[Qemu-devel] [PULL 00/17] ppc-for-2.10 queue 20170606

2017-06-05 Thread David Gibson
The following changes since commit 199e19ee538eb61fd08b1c1ee5aa838ebdcc968e: Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging (2017-06-05 15:28:12 +0100) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.10-20170606

[Qemu-devel] [PULL 02/17] migration: Mark CPU states dirty before incoming migration/loadvm

2017-06-05 Thread David Gibson
As a rule, CPU internal state should never be updated when !cpu->kvm_vcpu_dirty (or the HAX equivalent). If that is done, then subsequent calls to cpu_synchronize_state() - usually safe and idempotent - will clobber state. However, we routinely do this during a loadvm or incoming migration.

Re: [Qemu-devel] [PATCH v4 3/4] block: Simplify use of BDRV_BLOCK_RAW

2017-06-05 Thread Fam Zheng
On Mon, 06/05 15:38, Eric Blake wrote: > The lone caller that cares about a return of BDRV_BLOCK_RAW > (namely, io.c:bdrv_co_get_block_status) completely replaces the > return value, so there is no point in passing BDRV_BLOCK_DATA. > > Signed-off-by: Eric Blake > > --- > v3:

Re: [Qemu-devel] [PATCH v2 1/4] dump: add DumpInfo structure

2017-06-05 Thread Peter Xu
On Mon, Jun 05, 2017 at 09:24:38AM +0200, Andrew Jones wrote: > On Fri, Jun 02, 2017 at 09:46:35AM +, Marc-André Lureau wrote: > > Hi > > > > On Thu, Jun 1, 2017 at 10:19 PM Eric Blake wrote: > > > > > On 06/01/2017 01:06 PM, Laszlo Ersek wrote: > > > > On 06/01/17 15:03,

[Qemu-devel] [BUG] Failed to compile using gcc7.1

2017-06-05 Thread Qu Wenruo
Hi all, After upgrading gcc from 6.3.1 to 7.1.1, qemu can't be compiled with gcc. The error is: -- CC block/blkdebug.o block/blkdebug.c: In function 'blkdebug_refresh_filename': block/blkdebug.c:693:31: error: '%s' directive output may be truncated writing up to 4095 bytes into a

Re: [Qemu-devel] [PATCH RFC 4/6] migration: shut src return path unconditionally

2017-06-05 Thread Peter Xu
On Mon, Jun 05, 2017 at 03:22:24PM -0500, Eric Blake wrote: > On 05/19/2017 01:43 AM, Peter Xu wrote: > > We were do the shutting off only for postcopy. Now we do this as long as > > the source return path is there. > > > > Moving the cleanup of from_src_file there too. > > > > Signed-off-by:

Re: [Qemu-devel] [PATCH v2 2/6] pci: Add comment for pci_add_capability2()

2017-06-05 Thread Mao Zhongyi
Hi, Marcel On 06/05/2017 09:34 PM, Marcel Apfelbaum wrote: On 02/06/2017 10:54, Mao Zhongyi wrote: Add a comment for pci_add_capability2() to explain the return value. This may help to make a correct return value check for its callers. Cc: m...@redhat.com Cc: mar...@redhat.com Cc:

Re: [Qemu-devel] [PATCH v2 3/6] pci: Fix the wrong return value judgment condition

2017-06-05 Thread Mao Zhongyi
Hi, Marcel On 06/06/2017 12:20 AM, Marcel Apfelbaum wrote: On 02/06/2017 10:54, Mao Zhongyi wrote: On success, pci_add_capability2() returns a positive value. On failure, it sets an error and return a negative value. It doesn't always return 0. So the judgment condtion of

Re: [Qemu-devel] [PATCH v4 2/4] block: Guarantee that *file is set on bdrv_get_block_status()

2017-06-05 Thread John Snow
On 06/05/2017 04:38 PM, Eric Blake wrote: > We document that *file is valid if the return is not an error and > includes BDRV_BLOCK_OFFSET_VALID, but forgot to obey this contract > when a driver (such as blkdebug) lacks a callback. Messed up in > commit 67a0fd2 (v2.6), when we added the file

Re: [Qemu-devel] [PATCH v4 1/4] qemu-io: Don't die on second open

2017-06-05 Thread John Snow
On 06/05/2017 04:38 PM, Eric Blake wrote: > Most callback commands in qemu-io return 0 to keep the interpreter > loop running, or 1 to quit immediately. However, open_f() just > passed through the return value of openfile(), which has different > semantics of returning 0 if a file was opened,

Re: [Qemu-devel] [PATCH v2 1/1] s390x: vmstatify config migration for virtio-ccw

2017-06-05 Thread Dong Jia Shi
* Eric Blake [2017-06-05 07:19:14 -0500]: Hi Eric, > On 06/04/2017 10:09 PM, Dong Jia Shi wrote: > > * Halil Pasic [2017-06-02 16:05:31 +0200]: > > > > Hi Halil, > > > > Sorry for the late show up. I just found some nits, which could be > >

Re: [Qemu-devel] [PATCH v2] spapr: Allow boot from vhost-*-scsi backends

2017-06-05 Thread David Gibson
On Mon, Jun 05, 2017 at 04:55:18PM +0100, Felipe Franciosi wrote: > The current implementation of spapr_get_fw_dev_path() doesn't take into > consideration vhost-*-scsi devices. This makes said devices unbootable > on PPC as SLOF is unable to work out the path to scan boot disks. > > This makes

Re: [Qemu-devel] [PATCHv2 1/5] spapr: Introduce DRC subclasses

2017-06-05 Thread David Gibson
On Mon, Jun 05, 2017 at 11:32:07AM -0500, Michael Roth wrote: > Quoting David Gibson (2017-06-04 22:31:12) > > Currently we only have a single QOM type for all DRCs, but lots of > > places where we switch behaviour based on the DRC's PAPR defined type. > > This is a poor use of our existing type

Re: [Qemu-devel] [PATCH] ppc/pnv: check the return value of fd_setprop()

2017-06-05 Thread David Gibson
On Mon, Jun 05, 2017 at 05:44:21PM +0200, Cédric Le Goater wrote: > Signed-off-by: Cédric Le Goater Applied to ppc-for-2.10, thanks. > --- > hw/ppc/pnv.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > index

Re: [Qemu-devel] [PATCH] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs

2017-06-05 Thread David Gibson
On Fri, Jun 02, 2017 at 12:09:35PM +0200, Greg Kurz wrote: > As explained in commit 5c0139a8c2f0 ("spapr: fix default DRC state for > coldplugged LMBs"), guests expect cold-plugged LMBs to be pre-allocated > and unisolated. The same goes for cold-plugged CPUs. > > While here, let's convert

Re: [Qemu-devel] [PATCH] spapr_nvram: Check return value from blk_getlength()

2017-06-05 Thread David Gibson
On Mon, Jun 05, 2017 at 04:14:17PM +0100, Peter Maydell wrote: > The blk_getlength() function can return an error value if the > image size cannot be determined. Check for this rather than > ploughing on and trying to g_malloc0() a negative number. > (Spotted by Coverity, CID 1288484.) > >

Re: [Qemu-devel] BUG: KASAN: use-after-free in free_old_xmit_skbs

2017-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2017 at 05:08:25AM +0300, Michael S. Tsirkin wrote: > On Mon, Jun 05, 2017 at 12:48:53AM +0200, Jean-Philippe Menil wrote: > > Hi, > > > > while playing with xdp and ebpf, i'm hitting the following: > > > > [ 309.993136] > >

Re: [Qemu-devel] [PATCH v2 20/20] block: Make bdrv_is_allocated_above() byte-based

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will let us be more

Re: [Qemu-devel] [PATCH v2 20/20] block: Make bdrv_is_allocated_above() byte-based

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > -int64_t sector_num, int nb_sectors, int *pnum); > +int64_t offset, int64_t bytes, int64_t *pnum); Minor context conflict after this that, for whichever reason, git could not resolve on its own

Re: [Qemu-devel] [PATCH v2 18/20] block: Make bdrv_is_allocated() byte-based

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will let us be more

[Qemu-devel] [PATCH v2 3/3] tcg: allocate TB structs before the corresponding translated code

2017-06-05 Thread Emilio G. Cota
Allocating an arbitrarily-sized array of tbs results in either (a) a lot of memory wasted or (b) unnecessary flushes of the code cache when we run out of TB structs in the array. An obvious solution would be to just malloc a TB struct when needed, and keep the TB array as an array of pointers

[Qemu-devel] [PATCH v2 1/3] compiler: define QEMU_CACHELINE_SIZE

2017-06-05 Thread Emilio G. Cota
This is a constant used as a hint for padding structs to hopefully avoid false cache line sharing. The constant can be set at configure time by defining QEMU_CACHELINE_SIZE via --extra-cflags. If not set there, we try to obtain the value from the machine running the configure script. If we fail,

[Qemu-devel] [PATCH v2 2/3] tests: use QEMU_CACHELINE_SIZE instead of hard-coding it

2017-06-05 Thread Emilio G. Cota
Signed-off-by: Emilio G. Cota --- tests/atomic_add-bench.c | 4 ++-- tests/qht-bench.c| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/atomic_add-bench.c b/tests/atomic_add-bench.c index caa1e8e..c219109 100644 --- a/tests/atomic_add-bench.c

[Qemu-devel] [PATCH v2 0/3] tcg: allocate TB structs preceding translated code

2017-06-05 Thread Emilio G. Cota
. This patchset applies on top of rth's tcg-next branch (pull-tcg-20170605 tag). NB. Apologies if some emails sent to me bounced during the last couple of days; my domain name (braap.org) was down. Thanks, Emilio

Re: [Qemu-devel] [PATCH v2 15/20] backup: Switch block_backup.h to byte-based

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Continue by converting > the public interface to backup jobs (no semantic change), including > a change to CowRequest to track by bytes

Re: [Qemu-devel] qemu-system-sh4 -M r2d serial is broken.

2017-06-05 Thread Rob Landley
On 05/18/2017 06:01 PM, Aurelien Jarno wrote: > On 2017-05-18 17:37, Rob Landley wrote: >> On 05/18/2017 02:00 PM, Aurelien Jarno wrote: >>> On 2017-05-18 11:08, Rob Landley wrote: Serial input hangs after the first character in the 4.11 kernel:

Re: [Qemu-devel] [PATCH v2 10/20] mirror: Switch mirror_cow_align() to byte-based

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change), and add mirror_clip_bytes() as a > counterpart to mirror_clip_sectors(). Some of

Re: [Qemu-devel] [PATCH v2 09/20] mirror: Update signature of mirror_clip_sectors()

2017-06-05 Thread John Snow
On 05/10/2017 10:20 PM, Eric Blake wrote: > Rather than having a void function that modifies its input > in-place as the output, change the signature to reduce a layer > of indirection and return the result. > > Suggested-by: John Snow > Signed-off-by: Eric Blake

Re: [Qemu-devel] [PATCH v3 4/4] gdbstub: don't fail on vCont; C04:0; c packets

2017-06-05 Thread Philippe Mathieu-Daudé
On 06/02/2017 10:05 AM, Alex Bennée wrote: The thread-id of 0 means any CPU but we then ignore the fact we find the first_cpu in this case who can have an index of 0. Instead of bailing out just test if we have managed to match up thread-id to a CPU. Otherwise you get: gdb_handle_packet:

[Qemu-devel] [PATCH v4 1/4] qemu-io: Don't die on second open

2017-06-05 Thread Eric Blake
Most callback commands in qemu-io return 0 to keep the interpreter loop running, or 1 to quit immediately. However, open_f() just passed through the return value of openfile(), which has different semantics of returning 0 if a file was opened, or 1 on any failure. As a result of mixing the

[Qemu-devel] [PATCH v4 3/4] block: Simplify use of BDRV_BLOCK_RAW

2017-06-05 Thread Eric Blake
The lone caller that cares about a return of BDRV_BLOCK_RAW (namely, io.c:bdrv_co_get_block_status) completely replaces the return value, so there is no point in passing BDRV_BLOCK_DATA. Signed-off-by: Eric Blake --- v3: further document BDRV_BLOCK_RAW v2: fix subject, tweak

[Qemu-devel] [PATCH v4 4/4] blkdebug: Support .bdrv_co_get_block_status

2017-06-05 Thread Eric Blake
Without a passthrough status of BDRV_BLOCK_RAW, anything wrapped by blkdebug appears 100% allocated as data. Better is treating it the same as the underlying file being wrapped. Update iotest 177 for the new expected output. Signed-off-by: Eric Blake Reviewed-by: Fam Zheng

[Qemu-devel] [PATCH v4 2/4] block: Guarantee that *file is set on bdrv_get_block_status()

2017-06-05 Thread Eric Blake
We document that *file is valid if the return is not an error and includes BDRV_BLOCK_OFFSET_VALID, but forgot to obey this contract when a driver (such as blkdebug) lacks a callback. Messed up in commit 67a0fd2 (v2.6), when we added the file parameter. Enhance qemu-iotest 177 to cover this,

[Qemu-devel] [PATCH v4 0/4] more blkdebug tweaks

2017-06-05 Thread Eric Blake
I found a crasher and some odd behavior while rebasing my bdrv_get_block_status series, so I figured I'd get these things fixed first. This is based on top of Max's block branch. Available as a tag at: git fetch git://repo.or.cz/qemu/ericb.git nbd-blkdebug-status-v4 Since v3: - check all

Re: [Qemu-devel] [PATCH] block/gluster.c: Handle qdict_array_entries() failure

2017-06-05 Thread Jeff Cody
On Mon, Jun 05, 2017 at 06:01:38PM +0100, Peter Maydell wrote: > In qemu_gluster_parse_json(), the call to qdict_array_entries() > could return a negative error code, which we were ignoring > because we assigned the result to an unsigned variable. > Fix this by using the 'int' type instead, which

Re: [Qemu-devel] [PATCH RFC 4/6] migration: shut src return path unconditionally

2017-06-05 Thread Eric Blake
On 05/19/2017 01:43 AM, Peter Xu wrote: > We were do the shutting off only for postcopy. Now we do this as long as > the source return path is there. > > Moving the cleanup of from_src_file there too. > > Signed-off-by: Peter Xu > --- > migration/migration.c| 8 +++-

Re: [Qemu-devel] [PATCH] block/gluster.c: Handle qdict_array_entries() failure

2017-06-05 Thread Philippe Mathieu-Daudé
On 06/05/2017 02:01 PM, Peter Maydell wrote: In qemu_gluster_parse_json(), the call to qdict_array_entries() could return a negative error code, which we were ignoring because we assigned the result to an unsigned variable. Fix this by using the 'int' type instead, which matches the return type

Re: [Qemu-devel] [PATCH v1 1/1] char-socket: Don't report TCP socket waiting as an error

2017-06-05 Thread Philippe Mathieu-Daudé
On 06/05/2017 03:34 PM, Alistair Francis wrote: When QEMU is waiting for a TCP socket connection it reports that message as an error. This isn't an error though, so let's change the report to just use qemu_log(). Signed-off-by: Alistair Francis Reviewed-by:

Re: [Qemu-devel] [PATCH v3 1/4] qemu-io: Don't die on second open

2017-06-05 Thread Eric Blake
On 06/05/2017 02:08 PM, Eric Blake wrote: > > Note, however, that we do have some qemu-iotests that do 'qemu-io > -c "open file" -c "$something"'; such tests will now proceed to > attempt $something whether or not the open succeeded, the same way > as if the two commands had been attempted in

Re: [Qemu-devel] [PATCH v2 00/20] make bdrv_is_allocated[_above] byte-based

2017-06-05 Thread John Snow
On 06/05/2017 03:39 PM, Eric Blake wrote: > ping > ACK. > On 05/10/2017 09:20 PM, Eric Blake wrote: >> There are patches floating around to add NBD_CMD_BLOCK_STATUS, >> but NBD wants to report status on byte granularity (even if the >> reporting will probably be naturally aligned to sectors

Re: [Qemu-devel] [PATCH v2 00/20] make bdrv_is_allocated[_above] byte-based

2017-06-05 Thread Eric Blake
ping On 05/10/2017 09:20 PM, Eric Blake wrote: > There are patches floating around to add NBD_CMD_BLOCK_STATUS, > but NBD wants to report status on byte granularity (even if the > reporting will probably be naturally aligned to sectors or even > much higher levels). I've therefore started the

Re: [Qemu-devel] [PATCH v3 0/4] more blkdebug tweaks

2017-06-05 Thread Eric Blake
On 06/05/2017 02:31 PM, no-re...@patchew.org wrote: > 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. > > GTESTER tests/test-blockjob > GTESTER

Re: [Qemu-devel] [PATCH v3 0/4] more blkdebug tweaks

2017-06-05 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. Message-id: 20170605190824.25184-1-ebl...@redhat.com Subject: [Qemu-devel] [PATCH v3 0/4] more blkdebug tweaks Type: series

[Qemu-devel] SHPC in pci-bridge

2017-06-05 Thread Alexander Bezzubikov
Hi everyone, Does anyone use pci-bridge built-in SHPC and found it working (especially on x86 machines)? I really want to hear about such cases. When I'm trying to hotplug anything into the bridge without using ACPI on x86 machine, none of my linux guests can see it in lspci, and dmesg contains

[Qemu-devel] [PATCH v3 2/4] block: Guarantee that *file is set on bdrv_get_block_status()

2017-06-05 Thread Eric Blake
We document that *file is valid if the return is not an error and includes BDRV_BLOCK_OFFSET_VALID, but forgot to obey this contract when a driver (such as blkdebug) lacks a callback. Messed up in commit 67a0fd2 (v2.6), when we added the file parameter. Enhance qemu-iotest 177 to cover this,

[Qemu-devel] [PATCH v3 3/4] block: Simplify use of BDRV_BLOCK_RAW

2017-06-05 Thread Eric Blake
The lone caller that cares about a return of BDRV_BLOCK_RAW (namely, io.c:bdrv_co_get_block_status) completely replaces the return value, so there is no point in passing BDRV_BLOCK_DATA. Signed-off-by: Eric Blake --- v3: further document BDRV_BLOCK_RAW v2: fix subject, tweak

[Qemu-devel] [PATCH v3 1/4] qemu-io: Don't die on second open

2017-06-05 Thread Eric Blake
Most callback commands in qemu-io return 0 to keep the interpreter loop running, or 1 to quit immediately. However, open_f() just passed through the return value of openfile(), which has different semantics of returning 0 if a file was opened, or 1 on any failure. As a result of mixing the

[Qemu-devel] [PATCH v3 4/4] blkdebug: Support .bdrv_co_get_block_status

2017-06-05 Thread Eric Blake
Without a passthrough status of BDRV_BLOCK_RAW, anything wrapped by blkdebug appears 100% allocated as data. Better is treating it the same as the underlying file being wrapped. Update iotest 177 for the new expected output. Signed-off-by: Eric Blake Reviewed-by: Fam Zheng

[Qemu-devel] [PATCH v3 0/4] more blkdebug tweaks

2017-06-05 Thread Eric Blake
I found a crasher and some odd behavior while rebasing my bdrv_get_block_status series, so I figured I'd get these things fixed first. This is based on top of Max's block branch. Available as a tag at: git fetch git://repo.or.cz/qemu/ericb.git nbd-blkdebug-status-v3 Since v2: - defer the

[Qemu-devel] [PULL 10/10] scripts: Test script to look for -device crashes

2017-06-05 Thread Eduardo Habkost
Test code to check if we can crash QEMU using -device. It will test all accel/machine/device combinations by default, which may take a few hours (it's more than 90k test cases). There's a "-r" option that makes it test a random sample of combinations. The scripts contains a whitelist for: 1)

[Qemu-devel] [PULL 08/10] qemu.py: Don't set _popen=None on error/shutdown

2017-06-05 Thread Eduardo Habkost
Keep the Popen object around to we can query its exit code later. To keep the existing 'self._popen is None' checks working, add a is_running() method, that will check if the process is still running. Signed-off-by: Eduardo Habkost Message-Id:

[Qemu-devel] [PULL 07/10] spapr: cleanup spapr_fixup_cpu_numa_dt() usage

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov even though spapr_fixup_cpu_numa_dt() has no effect on FDT if numa is disabled, don't call it uselessly. It makes it obvious at call sites that function is needed only when numa is enabled. Signed-off-by: Igor Mammedov Message-Id:

[Qemu-devel] [PULL 09/10] qemu.py: Add QEMUMachine.exitcode() method

2017-06-05 Thread Eduardo Habkost
Allow the exit code of QEMU to be queried by scripts. Signed-off-by: Eduardo Habkost Message-Id: <20170526181200.17227-3-ehabk...@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qemu.py | 5 + 1 file changed, 5 insertions(+) diff --git

[Qemu-devel] [PULL 06/10] numa: move numa_node from CPUState into target specific classes

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov Move vcpu's associated numa_node field out of generic CPUState into inherited classes that actually care about cpu<->numa mapping, i.e: ARMCPU, PowerPCCPU, X86CPU. Signed-off-by: Igor Mammedov Message-Id:

[Qemu-devel] [PULL 04/10] numa: make sure that all cpus have has_node_id set if numa is enabled

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov It fixes/add missing _PXM object for non mapped CPU (x86) and missing fdt node (virt-arm). It ensures that possible_cpus contains complete mapping if numa is enabled by the time machine_init() is executed. As result non completely mapped CPUs: 1)

[Qemu-devel] [PULL 05/10] numa: make hmp 'info numa' fetch numa nodes from qmp_query_cpus() result

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov HMP command 'info numa' is the last external user that access CPUState::numa_node field directly. In order to move it to CPU classes that actually use it, eliminate direct access and use an alternative approach by using result of qmp_query_cpus(), which

[Qemu-devel] [PULL 03/10] numa: move default mapping init to machine

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov there is no need use cpu_index_to_instance_props() for setting default cpu -> node mapping. Generic machine code can do it without cpu_index by just enabling already preset defaults in possible_cpus. PS: as bonus it makes one less user of

[Qemu-devel] [PULL 01/10] pc: Use "min-[x]level" on compat_props

2017-06-05 Thread Eduardo Habkost
Since the automatic cpuid-level code was introduced in commit c39c0edf9bb3b968ba95484465a50c7b19f4aa3a ("target-i386: Automatically set level/xlevel/xlevel2 when needed"), the CPU model tables just define the default CPUID level code (set using "min-level"). Setting "[x]level" forces CPUID level

[Qemu-devel] [PULL 00/10] x86 and machine queue, 2017-06-05

2017-06-05 Thread Eduardo Habkost
The following changes since commit cb8b8ef4578dc17c350fd4b27700a9f178e2dad0: Merge remote-tracking branch 'remotes/elmarco/tags/chrfe-pull-request' into staging (2017-06-05 10:09:14 +0100) are available in the git repository at: git://github.com/ehabkost/qemu.git

[Qemu-devel] [PULL 02/10] numa: consolidate cpu_preplug fixups/checks for pc/arm/spapr

2017-06-05 Thread Eduardo Habkost
From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: David Gibson Message-Id: <1496161442-96665-2-git-send-email-imamm...@redhat.com> [ehabkost: Fix indentation] Signed-off-by: Eduardo Habkost

Re: [Qemu-devel] [PATCH] pc: Use "min-[x]level" on compat_props

2017-06-05 Thread Eduardo Habkost
On Mon, Jun 05, 2017 at 07:07:21PM +0300, Michael S. Tsirkin wrote: [...] > > With above tweaks: > > Acked-by: Michael S. Tsirkin > > feel free to merge this through your tree. Thanks. Queued on my x86-next branch. -- Eduardo

[Qemu-devel] [PATCH v1 1/1] char-socket: Don't report TCP socket waiting as an error

2017-06-05 Thread Alistair Francis
When QEMU is waiting for a TCP socket connection it reports that message as an error. This isn't an error though, so let's change the report to just use qemu_log(). Signed-off-by: Alistair Francis --- chardev/char-socket.c | 3 ++- 1 file changed, 2 insertions(+),

Re: [Qemu-devel] [PATCH 0/2] slirp: handle errors in sosendoob()

2017-06-05 Thread no-reply
Hi, This series seems to have some coding style problems. See output below for more information: Message-id: 1496679576-14336-1-git-send-email-peter.mayd...@linaro.org Subject: [Qemu-devel] [PATCH 0/2] slirp: handle errors in sosendoob() Type: series === TEST SCRIPT BEGIN === #!/bin/bash

Re: [Qemu-devel] [PATCH] block/gluster.c: Handle qdict_array_entries() failure

2017-06-05 Thread Eric Blake
On 06/05/2017 12:01 PM, Peter Maydell wrote: > In qemu_gluster_parse_json(), the call to qdict_array_entries() > could return a negative error code, which we were ignoring > because we assigned the result to an unsigned variable. > Fix this by using the 'int' type instead, which matches the >

Re: [Qemu-devel] [PATCH] pc: Use "min-[x]level" on compat_props

2017-06-05 Thread Eduardo Habkost
On Mon, Jun 05, 2017 at 12:56:55PM -0300, Eduardo Habkost wrote: > Since the automatic cpuid-level code was introduced in commit > c39c0edf9bb3b968ba95484465a50c7b19f4aa3a, the CPU model tables just > define the default CPUID level code (set using "min-level"). Setting > "[x]level" forces CPUID

[Qemu-devel] [PATCH v3] target-ppc: Enable open-pic timers to count and generate interrupts

2017-06-05 Thread Aaron Larson
Previously QEMU open-pic implemented the 4 open-pic timers including all timer registers, but the timers did not "count" or generate any interrupts. The patch makes the timers both count and generate interrupts. The timer clock frequency is fixed at 25MHZ. -- Responding to V2 patch comments. -

[Qemu-devel] [PULL 17/26] tcg/arm: Implement goto_ptr

2017-06-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- tcg/arm/tcg-target.h | 2 +- tcg/arm/tcg-target.inc.c | 25 + 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/tcg/arm/tcg-target.h b/tcg/arm/tcg-target.h index c114df7..5ef1086 100644 ---

[Qemu-devel] [PULL 26/26] target/alpha: Use goto_tb for fallthru between TBs

2017-06-05 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/alpha/translate.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 4523c4c..7c45ae3 100644 --- a/target/alpha/translate.c +++

[Qemu-devel] [PATCH] block/gluster.c: Handle qdict_array_entries() failure

2017-06-05 Thread Peter Maydell
In qemu_gluster_parse_json(), the call to qdict_array_entries() could return a negative error code, which we were ignoring because we assigned the result to an unsigned variable. Fix this by using the 'int' type instead, which matches the return type of qdict_array_entries() and also the type we

[Qemu-devel] [PULL 15/26] tcg/s390: Implement goto_ptr

2017-06-05 Thread Richard Henderson
Tested-by: Aurelien Jarno Reviewed-by: Aurelien Jarno Signed-off-by: Richard Henderson --- tcg/s390/tcg-target.h | 2 +- tcg/s390/tcg-target.inc.c | 24 +--- 2 files changed, 22 insertions(+), 4 deletions(-)

[Qemu-devel] [PULL 24/26] target/mips: optimize indirect branches

2017-06-05 Thread Richard Henderson
From: Aurelien Jarno Cc: Yongbok Kim Signed-off-by: Aurelien Jarno Message-Id: <20170430145254.25616-4-aurel...@aurel32.net> Signed-off-by: Richard Henderson --- target/mips/translate.c | 2 +- 1 file

  1   2   3   >