Re: [Qemu-devel] [PATCH] target-mips: silence NaNs for cvt.s.d and cvt.d.s

2016-01-24 Thread Peter Maydell
On 24 January 2016 at 03:42, Maciej W. Rozycki wrote: > > FYI, I posted a more general fix to this a while ago, however the review > regrettably went nowhere. See the archive of discussion starting at: > > for details, inclu

Re: [Qemu-devel] [PATCH v14 0/8] Block replication for continuous checkpoints

2016-01-24 Thread Wen Congyang
Stefan:ping Do you have time to review this series patchset? Thanks Wen Congyang At 2016/1/13 17:18, Changlong Xie wrote: Block replication is a very important feature which is used for continuous checkpoints(for example: COLO). You can get the detailed information about block replication fro

Re: [Qemu-devel] [PATCH v11 7/7] arm_mptimer: Convert to use ptimer

2016-01-24 Thread Dmitry Osipenko
Hello Peter, 24.01.2016 08:25, Peter Crosthwaite пишет: [snip] +timerblock_run(tb->timer, control, (value != 0) && (control & 1)); break; case 8: /* Control. */ -old = tb->control; -tb->control = value; -if (value & 1) { -if ((old &

Re: [Qemu-devel] [PATCH v11 6/7] hw/ptimer: Legalize running with delta = load = 0 and abort on period = 0

2016-01-24 Thread Dmitry Osipenko
24.01.2016 07:28, Peter Crosthwaite пишет: [snip] /* Set counter frequency in Hz. */ void ptimer_set_freq(ptimer_state *s, uint32_t freq) { +g_assert(freq != 0); s->delta = ptimer_get_count(s); s->period = 10ll / freq; s->period_frac = (10ll << 32) /

Re: [Qemu-devel] [vfio-users] [PATCH v2 1/3] input: add qemu_input_qcode_to_linux + qemu_input_linux_to_qcode

2016-01-24 Thread Jonathan Scruggs
Hi Gerd, A couple of options I have been wondering about. 1) Is it possible to have an option that would enable running a program on the host on switching, IE when both CRTL keys are pressed. It would run on the host regardless if it was on the guest machine when the keys pressed. An option like

Re: [Qemu-devel] [PATCH 04/13] cuda: port SET_AUTO_RATE command to new framework

2016-01-24 Thread Hervé Poussineau
Le 23/01/2016 21:40, Hervé Poussineau a écrit : Take requested autopoll rate into account Signed-off-by: Hervé Poussineau --- hw/misc/macio/cuda.c | 31 +++ hw/ppc/mac.h | 1 + 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/hw/misc/macio

Re: [Qemu-devel] [Qemu-ppc] [PATCH 05/13] cuda: port SET_DEVICE_LIST command to new framework

2016-01-24 Thread Programmingkid
On Jan 23, 2016, at 3:41 PM, qemu-ppc-requ...@nongnu.org wrote: > Message: 6 > Date: Sat, 23 Jan 2016 21:40:02 +0100 > From: Herv? Poussineau > To: qemu-devel@nongnu.org > Cc: Alyssa Milburn , Herv? Poussineau > , qemu-...@nongnu.org, David Gibson > > Subject: [Qemu-ppc] [PATCH 05/1

Re: [Qemu-devel] [PATCH 11/13] cuda: port SET_TIME command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:08PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 24 ++-- > 1 file changed, 18 insertions(+), 6 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cu

Re: [Qemu-devel] [PATCH 04/13] cuda: port SET_AUTO_RATE command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:01PM +0100, Hervé Poussineau wrote: > Take requested autopoll rate into account Commit message needs some work - as far as I can tell this is not just moving this to the new framework, but implementing it - previously the command was silently ignored. > > Signed-off

Re: [Qemu-devel] [PATCH 07/13] cuda: port RESET_SYSTEM command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:04PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 17 + > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c >

Re: [Qemu-devel] [PATCH 03/13] cuda: port AUTOPOLL command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:00PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 40 +--- > 1 file changed, 25 insertions(+), 15 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b

Re: [Qemu-devel] [PATCH 02/13] cuda: reject unknown commands

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:39:59PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau > --- > hw/misc/macio/cuda.c | 25 - > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c > index 69f69c2..f27dd1

Re: [Qemu-devel] [PATCH 01/13] cuda: add a framework to handle commands

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:39:58PM +0100, Hervé Poussineau wrote: > Next commits will port existing CUDA commands to this framework. > > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 34 ++ > 1 file changed, 34 inserti

Re: [Qemu-devel] [PATCH 00/13] cuda: misc fixes and cleanups

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:39:57PM +0100, Hervé Poussineau wrote: > Hi, > > This patchset cleans up a little bit the Apple CUDA emulation: > - correctly reject unknown commands > - correctly reject commands with wrong parameters > - support changing the frequency of auto-polling > - support changi

Re: [Qemu-devel] [PATCH 05/13] cuda: port SET_DEVICE_LIST command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:02PM +0100, Hervé Poussineau wrote: > Take device list mask into account when polling ADB devices. Again, this appears to implement the command, not just move it. > Signed-off-by: Hervé Poussineau > --- > hw/input/adb.c | 18 ++ > hw/misc/m

Re: [Qemu-devel] [PATCH 09/13] cuda: port SET_POWER_MESSAGES command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:06PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Revieed-by: David Gibson > --- > hw/misc/macio/cuda.c | 19 --- > 1 file changed, 16 insertions(+), 3 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c >

Re: [Qemu-devel] [PATCH] cuda.c: return error for unknown commands

2016-01-24 Thread David Gibson
On Fri, Jan 22, 2016 at 11:07:24PM +, Alyssa Milburn wrote: > This avoids MacsBug hanging at startup in the absence of ADB mouse > input, by replying with an error (which is also what MOL does) when > it sends an unknown command (0x1c). > > Signed-off-by: Alyssa Milburn I've applied this to

Re: [Qemu-devel] [PATCH 10/13] cuda: port GET_TIME command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:07PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 29 + > 1 file changed, 21 insertions(+), 8 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/mac

Re: [Qemu-devel] [PATCH 06/13] cuda: port POWERDOWN command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:03PM +0100, Hervé Poussineau wrote: > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 17 + > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c >

Re: [Qemu-devel] [PATCH 08/13] cuda: port FILE_SERVER_FLAG command to new framework

2016-01-24 Thread David Gibson
On Sat, Jan 23, 2016 at 09:40:05PM +0100, Hervé Poussineau wrote: > This command tells if computer should automatically wake-up after a power > loss. > > Signed-off-by: Hervé Poussineau Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 17 - > 1 file changed, 16 insert

Re: [Qemu-devel] [PATCH] hw/pci-host/uninorth.c: Add support for Apple's PCI bridge register 0x48

2016-01-24 Thread David Gibson
On Fri, Jan 22, 2016 at 07:13:28PM +, Mark Cave-Ayland wrote: > On 22/01/16 18:26, Programmingkid wrote: > > > On Jan 22, 2016, at 11:46 AM, Mark Cave-Ayland wrote: > > > >> On 22/01/16 16:09, Programmingkid wrote: > >> > >>> Apple has custom PCI bridge registers that are not a part of any kn

Re: [Qemu-devel] [PATCH v2] .travis.yml: migrate to container builds

2016-01-24 Thread David Gibson
On Thu, Jan 21, 2016 at 10:28:05PM +, Alex Bennée wrote: > This moves the Travis tests from the legacy VM infrastructure (which > only seems to run 5-6 jobs at once) to the new container based approach. > > The principle difference is there is no sudo in the containers so all > packages are in

Re: [Qemu-devel] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-24 Thread Wen Congyang
On 01/22/2016 11:14 PM, Dr. David Alan Gilbert wrote: > Hi, > I can trigger a segfault if I wire in the block replication together with > a quorum instance; it only triggers with both of them present but, > it looks like the problem is a disagreement about the number of quorum > members; I'm tri

Re: [Qemu-devel] [PATCH v9 2/3] quorum: implement bdrv_add_child() and bdrv_del_child()

2016-01-24 Thread Wen Congyang
On 01/23/2016 04:02 AM, Dr. David Alan Gilbert wrote: > * Alberto Garcia (be...@igalia.com) wrote: >> On Thu 21 Jan 2016 05:58:42 PM CET, Eric Blake wrote: >> In general, what do you do to make sure that the data in a new Quorum >> child is consistent with that of the rest of the array? >>

[Qemu-devel] [PULL 04/28] macio: add dma_active to VMStateDescription

2016-01-24 Thread David Gibson
From: Mark Cave-Ayland Make sure that we include the value of dma_active in the migration stream. Signed-off-by: Mark Cave-Ayland Acked-by: John Snow Signed-off-by: David Gibson --- hw/ide/macio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/ide/macio.c b/hw/ide/m

[Qemu-devel] [PULL 02/28] target-ppc: use cpu_write_xer() helper in cpu_post_load

2016-01-24 Thread David Gibson
From: Mark Cave-Ayland Otherwise some internal xer variables fail to get set post-migration. Signed-off-by: Mark Cave-Ayland Reviewed-by: Alexey Kardashevskiy Signed-off-by: David Gibson --- target-ppc/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-ppc/m

[Qemu-devel] [PULL 13/28] pseries: Clean up error handling in spapr_validate_node_memory()

2016-01-24 Thread David Gibson
Use error_setg() and return an error, rather than using an explicit exit(). Also improve messages, and be more explicit about which constraint failed. Signed-off-by: David Gibson Reviewed-by: Bharata B Rao Reviewed-by: Thomas Huth Reviewed-by: Alexey Kardashevskiy Reviewed-by: Markus Armbrust

[Qemu-devel] [PULL 05/28] mac_dbdma: add DBDMA controller state to VMStateDescription

2016-01-24 Thread David Gibson
From: Mark Cave-Ayland Make sure that we include the DBDMA controller state in the migration stream. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/mac_dbdma.c | 40 1 file changed, 36 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PULL 09/28] spapr: Remove abuse of rtas_ld() in h_client_architecture_support

2016-01-24 Thread David Gibson
h_client_architecture_support() uses rtas_ld() for general purpose memory access, despite the fact that it's not an RTAS routine at all and rtas_ld makes things more awkward. Clean this up by replacing rtas_ld() calls with appropriate ldXX_phys() calls. Signed-off-by: David Gibson Reviewed-by: A

[Qemu-devel] [PULL 00/28] ppc-for-2.6 queue 20160125

2016-01-24 Thread David Gibson
The following changes since commit 047e363b05679724d6b784c6ec6310697fe48ba0: Merge remote-tracking branch 'remotes/pmaydell/tags/pull-softfloat-20160122' into staging (2016-01-22 15:19:21 +) are available in the git repository at: git://github.com/dgibson/qemu.git tags/ppc-for-2.6-20160

[Qemu-devel] [PULL 01/28] target-ppc: Use sensible POWER8/POWER8E versions

2016-01-24 Thread David Gibson
From: Benjamin Herrenschmidt We never released anything older than POWER8 DD2.0 and POWER8E DD2.1, so let's use these versions, without that some firmware or Linux code might fail to use some HW features that were non functional in earlier internal only spins of the chip. Signed-off-by: Benjamin

[Qemu-devel] [PULL 10/28] spapr: Don't create ibm, dynamic-reconfiguration-memory w/o DR LMBs

2016-01-24 Thread David Gibson
From: Bharata B Rao If guest doesn't have any dynamically reconfigurable (DR) logical memory blocks (LMB), then we shouldn't create ibm,dynamic-reconfiguration-memory device tree node. Signed-off-by: Bharata B Rao Signed-off-by: David Gibson --- hw/ppc/spapr.c | 9 - 1 file changed, 8

[Qemu-devel] [PULL 15/28] pseries: Clean up error handling in spapr_rtas_register()

2016-01-24 Thread David Gibson
The errors detected in this function necessarily indicate bugs in the rest of the qemu code, rather than an external or configuration problem. So, a simple assert() is more appropriate than any more complex error reporting. Signed-off-by: David Gibson Reviewed-by: Thomas Huth Reviewed-by: Alexe

[Qemu-devel] [PULL 12/28] pseries: Clean up error handling of spapr_cpu_init()

2016-01-24 Thread David Gibson
Currently spapr_cpu_init() is hardcoded to handle any errors as fatal. That works for now, since it's only called from initial setup where an error here means we really can't proceed. However, we'll want to handle this more flexibly for cpu hotplug in future so generalize this using the error repo

[Qemu-devel] [PULL 11/28] ppc: Clean up error handling in ppc_set_compat()

2016-01-24 Thread David Gibson
Current ppc_set_compat() returns -1 for errors, and also (unconditionally) reports an error message. The caller in h_client_architecture_support() may then report it again using an outdated fprintf(). Clean this up by using the modern error reporting mechanisms. Also add strerror(errno) to the e

[Qemu-devel] [PULL 07/28] spapr: Small fixes to rtas_ibm_get_system_parameter, remove rtas_st_buffer

2016-01-24 Thread David Gibson
rtas_st_buffer() appears in spapr.h as though it were a widely used helper, but in fact it is only used for saving data in a format used by rtas_ibm_get_system_parameter(). This changes it to a local helper more specifically for that function. While we're there fix a couple of small defects in rt

[Qemu-devel] [PULL 20/28] target-ppc: rename and export maybe_bswap_register()

2016-01-24 Thread David Gibson
From: Greg Kurz This helper will be used to support FP, Altivec and VSX registers when the guest is little-endian. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- target-ppc/cpu.h | 1 + target-ppc/gdbstub.c | 10 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff

[Qemu-devel] [PULL 14/28] pseries: Clean up error handling in spapr_vga_init()

2016-01-24 Thread David Gibson
Use error_setg() to return an error rather than an explicit exit(). Previously it was an exit(0) instead of a non-zero exit code, which was simply a bug. Also improve the error message. While we're at it change the type of spapr_vga_init() to bool since that's how we're using it anyway. Signed-o

[Qemu-devel] [PULL 21/28] target-ppc: gdbstub: fix float registers for little-endian guests

2016-01-24 Thread David Gibson
From: Greg Kurz Let's reuse the ppc_maybe_bswap_register() helper, like we already do with the general registers. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- target-ppc/translate_init.c | 4 1 file changed, 4 insertions(+) diff --git a/target-ppc/translate_init.c b/target-p

[Qemu-devel] [PULL 18/28] pseries: Clean up error reporting in htab migration functions

2016-01-24 Thread David Gibson
The functions for migrating the hash page table on pseries machine type (htab_save_setup() and htab_load()) can report some errors with an explicit fprintf() before returning an appropriate error code. Change some of these to use error_report() instead. htab_save_setup() is omitted for now to avoi

[Qemu-devel] [PULL 06/28] cuda: add missing fields to VMStateDescription

2016-01-24 Thread David Gibson
From: Mark Cave-Ayland Include some fields missed from the previous VMState conversion to the migration stream, as well as the new SR_INT delay timer. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions

[Qemu-devel] [PULL 17/28] pseries: Clean up error reporting in ppc_spapr_init()

2016-01-24 Thread David Gibson
This function includes a number of explicit fprintf()s for errors. Change these to use error_report() instead. Also replace the single exit(EXIT_FAILURE) with an explicit exit(1), since the latter is the more usual idiom in qemu by a large margin. Signed-off-by: David Gibson Reviewed-by: Alexey

[Qemu-devel] [PULL 26/28] pseries: Allow TCG h_enter to work with hotplugged memory

2016-01-24 Thread David Gibson
The implementation of the H_ENTER hypercall for PAPR guests needs to enforce correct access attributes on the inserted HPTE. This means determining if the HPTE's real address is a regular RAM address (which requires attributes for coherent access) or an IO address (which requires attributes for ca

[Qemu-devel] [PULL 27/28] cuda.c: return error for unknown commands

2016-01-24 Thread David Gibson
From: Alyssa Milburn This avoids MacsBug hanging at startup in the absence of ADB mouse input, by replying with an error (which is also what MOL does) when it sends an unknown command (0x1c). Signed-off-by: Alyssa Milburn Signed-off-by: David Gibson --- hw/misc/macio/cuda.c | 5 + 1 file

[Qemu-devel] [PULL 08/28] spapr: Remove rtas_st_buffer_direct()

2016-01-24 Thread David Gibson
rtas_st_buffer_direct() is a not particularly useful wrapper around cpu_physical_memory_write(). All the callers are in rtas_ibm_configure_connector, where it's better handled by local helper. Signed-off-by: David Gibson Reviewed-by: Alexey Kardashevskiy --- hw/ppc/spapr_rtas.c| 17 +++

[Qemu-devel] [PULL 03/28] macio: use the existing IDEDMA aiocb to hold the active DMA aiocb

2016-01-24 Thread David Gibson
From: Mark Cave-Ayland Currently the aiocb is held within MACIOIDEState, however the IDE core code assumes that the current actvie DMA aiocb is held in aiocb in a few places, e.g. ide_bus_reset() and ide_reset(). Switch over to using IDEDMA aiocb to store the aiocb for the current active DMA req

[Qemu-devel] [PULL 16/28] pseries: Clean up error handling in xics_system_init()

2016-01-24 Thread David Gibson
Use the error handling infrastructure to pass an error out from try_create_xics() instead of assuming &error_abort - the caller is in a better position to decide on error handling policy. Also change the error handling from an &error_abort to &error_fatal, since this occurs during the initial mach

[Qemu-devel] [PULL 22/28] target-ppc: gdbstub: introduce avr_need_swap()

2016-01-24 Thread David Gibson
From: Greg Kurz This helper will be used to support Altivec registers in little-endian guests. This patch does not change functionnality. Note: I had to put the helper some lines away from the gdb_*_avr_reg() routines to get a more readable patch. Signed-off-by: Greg Kurz Signed-off-by: David

[Qemu-devel] [PULL 28/28] uninorth.c: add support for UniNorth kMacRISCPCIAddressSelect (0x48) register

2016-01-24 Thread David Gibson
From: Programmingkid Darwin/OS X use the undocumented kMacRISCPCIAddressSelect (0x48) to configure PCI memory space size for mac99 machines. Without this register, warnings similar to below are emitted to the console during boot: AppleMacRiscPCI: bad range 2(8000:0100) AppleMacRiscPCI: b

[Qemu-devel] [PULL 19/28] target-ppc: kvm: fix floating point registers sync on little-endian hosts

2016-01-24 Thread David Gibson
From: Greg Kurz On VSX capable CPUs, the 32 FP registers are mapped to the high-bits of the 32 first VSX registers. So if you have: VSR31 = (uint128) 0x0102030405060708090a0b0c0d0e0f00 then FPR31 = (uint64) 0x0102030405060708 The kernel stores the VSX registers in the fp_state struct followin

[Qemu-devel] [PULL 23/28] target-ppc: gdbstub: fix altivec registers for little-endian guests

2016-01-24 Thread David Gibson
From: Greg Kurz Altivec registers are 128-bit wide. They are stored in memory as two 64-bit values that must be byteswapped when the guest is little-endian. Let's reuse the ppc_maybe_bswap_register() helper for this. We also need to fix the ordering of the 64-bit elements according to the target

Re: [Qemu-devel] [PATCH v13 00/10] Block replication for continuous checkpoints

2016-01-24 Thread Wen Congyang
On 01/22/2016 11:14 PM, Dr. David Alan Gilbert wrote: > Hi, > I can trigger a segfault if I wire in the block replication together with > a quorum instance; it only triggers with both of them present but, > it looks like the problem is a disagreement about the number of quorum > members; I'm tri

[Qemu-devel] [PULL 24/28] target-ppc: gdbstub: fix spe registers for little-endian guests

2016-01-24 Thread David Gibson
From: Greg Kurz Let's reuse the ppc_maybe_bswap_register() helper, like we already do with the general registers. Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- target-ppc/translate_init.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target-ppc/tra

[Qemu-devel] [PULL 25/28] target-ppc: gdbstub: Add VSX support

2016-01-24 Thread David Gibson
From: Anton Blanchard Add the XML and functions to get and set VSX registers. Signed-off-by: Anton Blanchard (fixed little-endian guests) Signed-off-by: Greg Kurz Signed-off-by: David Gibson --- configure | 6 +++--- gdb-xml/power-vsx.xml | 44 +++

Re: [Qemu-devel] COLO: how to flip a secondary to a primary?

2016-01-24 Thread Wen Congyang
On 01/23/2016 03:35 AM, Dr. David Alan Gilbert wrote: > Hi, > I've been looking at what's needed to add a new secondary after > a primary failed; from the block side it doesn't look as hard > as I'd expected, perhaps you can tell me if I'm missing something! > > The normal primary setup is: > >

Re: [Qemu-devel] [PATCH RFC 0/7] Netfilter: Add each netdev a default filter

2016-01-24 Thread Hailiang Zhang
On 2016/1/22 18:38, Daniel P. Berrange wrote: On Fri, Jan 22, 2016 at 06:35:48PM +0800, Hailiang Zhang wrote: On 2016/1/22 18:07, Daniel P. Berrange wrote: On Fri, Jan 22, 2016 at 04:36:44PM +0800, zhanghailiang wrote: This series is a prerequisite for COLO, here we add each netdev a default b

Re: [Qemu-devel] COLO: how to flip a secondary to a primary?

2016-01-24 Thread Li Zhijian
On 01/25/2016 09:32 AM, Wen Congyang wrote: >f) I've not thought about the colo-proxy that much yet - I guess that > existing connections need to keep their sequence number offset but Strictly speaking, after failover, we only need to keep servicing for the tcp connections which ar

Re: [Qemu-devel] [PATCH v7 15/15] iotests: Add "qemu-img map" test for VMDK extents

2016-01-24 Thread Fam Zheng
On Sat, 01/23 00:51, Max Reitz wrote: > On 22.01.2016 04:06, Fam Zheng wrote: > > Reviewed-by: Eric Blake > > Reviewed-by: Stefan Hajnoczi > > Signed-off-by: Fam Zheng > > --- > > tests/qemu-iotests/059 | 10 ++ > > tests/qemu-iotests/059.out | 38 +++

[Qemu-devel] [PATCH] vmdk: Fix converting to streamOptimized

2016-01-24 Thread Fam Zheng
Commit d62d9dc4b8 lifted streamOptimized images's version to 3, but we now refuse to open version 3 images read-write. We need to make streamOptimized an exception to allow converting to it. This fixes the accidentally broken iotests case 059 for the same reason. Signed-off-by: Fam Zheng --- bl

[Qemu-devel] [PATCH v8 00/15] qemu-img map: Allow driver to return file of the allocated block

2016-01-24 Thread Fam Zheng
v8: Fix patch 15. [Max] Add Max's rev-by in patch 1. v7: Rebase, update patch 1 for two new bdrv_get_block_status_above() callers in qemu-img.c. [Max] Add Max's rev-by in patch 12. Original cover letter - I stumbled upon this when looking at external bitmap format

[Qemu-devel] [PATCH v8 03/15] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index d4ea6b4..8babecd 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1349,6 +1349,7 @@ static int64_t coroutine_fn qcow2_co_get_block_st

[Qemu-devel] [PATCH v8 02/15] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow.c b/block/qcow.c index 4202797..251910c 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -510,6 +510,7 @@ static int64_t coroutine_fn qco

[Qemu-devel] [PATCH v8 10/15] vpc: Assign bs->file->bs to file in vpc_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index a070307..f504536 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -589,6 +589,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDr

[Qemu-devel] [PATCH v8 06/15] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index e2de308..645521d 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -274,6 +274,7 @@ static

[Qemu-devel] [PATCH v8 01/15] block: Add "file" output parameter to block status query functions

2016-01-24 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is referring to. Its value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status. The "bs->

[Qemu-devel] [PATCH v8 12/15] block: Use returned *file in bdrv_co_get_block_status

2016-01-24 Thread Fam Zheng
Now that all drivers return the right "file" pointer, we can use it. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- block/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/io.c b/block/io.c index 0836991..d704d32 100644 --- a/block/io.c +++ b/block/io.c @@

[Qemu-devel] [PATCH v8 14/15] qemu-img: Make MapEntry a QAPI struct

2016-01-24 Thread Fam Zheng
The "flags" bit mask is expanded to two booleans, "data" and "zero"; "bs" is replaced with "filename" string. Refactor the merge conditions in img_map() into entry_mergeable(). Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- qapi/block-core.json | 27

[Qemu-devel] [PATCH v8 08/15] sheepdog: Assign bs to file in sd_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/sheepdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 2ea05a6..a0098c1 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2739,6 +2739,9 @@ sd_co_get_block_status(BlockDriv

[Qemu-devel] [PATCH v8 04/15] raw: Assign bs to file in raw_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 3ef9b25..8866121 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c

[Qemu-devel] [PATCH v8 11/15] vmdk: Return extent's file in bdrv_get_block_status

2016-01-24 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- block/vmdk.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index e1d3e27..f8f7fcf 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1274,6 +1274,7 @@ static int64_t coroutine_fn vmdk_

[Qemu-devel] [PATCH v8 15/15] iotests: Add "qemu-img map" test for VMDK extents

2016-01-24 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/059 | 10 ++ tests/qemu-iotests/059.out | 26 ++ 2 files changed, 36 insertions(+) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 0ded0c3..0332bbb 100755 --- a/tests/qemu-iotests/059 +++ b/tes

[Qemu-devel] [PATCH v8 05/15] iscsi: Assign bs to file in iscsi_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index e182557..9fe76f4 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -625,6 +625,9 @@ out: if (iTask.task

[Qemu-devel] [PATCH v8 07/15] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qed.c b/block/qed.c index 8f6f841..404be1e 100644 --- a/block/qed.c +++ b/block/qed.c @@ -693,6 +693,7 @@ typedef struct { uint64_t pos

[Qemu-devel] [PATCH v8 09/15] vdi: Assign bs->file->bs to file in vdi_co_get_block_status

2016-01-24 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index 294c438..b403243 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -551,6 +551,7 @@ static int64_t coroutine_fn vdi_co_get_block_status(BlockDriv

[Qemu-devel] [PATCH v8 13/15] qemu-img: In "map", use the returned "file" from bdrv_get_block_status

2016-01-24 Thread Fam Zheng
Now all drivers should return a correct "file", we can make use of it, even with the recursion into backing chain above. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b

Re: [Qemu-devel] [PATCH RFC 0/7] Netfilter: Add each netdev a default filter

2016-01-24 Thread Jason Wang
On 01/22/2016 06:07 PM, Daniel P. Berrange wrote: > On Fri, Jan 22, 2016 at 04:36:44PM +0800, zhanghailiang wrote: >> This series is a prerequisite for COLO, here we add each netdev >> a default buffer filter, it is disabled by default, and has >> no side effect for delivering packets in net laye

Re: [Qemu-devel] [PATCH] net: walk through filters reversely if traffic is outgress

2016-01-24 Thread Jason Wang
On 01/22/2016 04:11 PM, Li Zhijian wrote: > Previously, if the netdev has more than one filters, the ingress > or outgress traffic pass the filter in the same order. this patch > is to make the outgress pass the filter in a reverse order Need a description why we need this. > > Signed-off-by: W

Re: [Qemu-devel] [PATCH RFC 1/7] net/filter: Fix the output information for command 'info network'

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > The properties of netfilter object could be changed by 'qom-set' > command, but the output of 'info network' command is not updated, > because it got the old information through nf->info_str, it will > not be updated while we change the value of netf

Re: [Qemu-devel] [PATCH RFC 3/7] net/filter: Skip the disabled filter when delivering packets

2016-01-24 Thread Jason Wang
On 01/22/2016 05:32 PM, Wen Congyang wrote: > On 01/22/2016 04:36 PM, zhanghailiang wrote: >> If the filter is disabled, don't go through it. >> >> Signed-off-by: zhanghailiang >> --- >> include/net/filter.h | 5 + >> net/net.c| 4 >> 2 files changed, 9 insertions(+) >> >>

Re: [Qemu-devel] [PATCH RFC 2/7] net/filter: Add a 'status' property for filter object

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > With this property, users can control if this filter is 'enable' > or 'disable'. The default behavior for filter is enabled. > > Signed-off-by: zhanghailiang Let's squash patch 3 into this for a complete implementation of 'status'. > --- > includ

[Qemu-devel] [PATCH 03/10] target-ppc: Rework ppc_store_slb

2016-01-24 Thread David Gibson
ppc_store_slb updates the SLB for PPC cpus with 64-bit hash MMUs. Currently it takes two parameters, which contain values encoded as the register arguments to the slbmte instruction, one register contains the ESID portion of the SLBE and also the slot number, the other contains the VSID portion of

[Qemu-devel] [PATCH 01/10] target-ppc: Remove unused kvmppc_read_segment_page_sizes() stub

2016-01-24 Thread David Gibson
This stub function is in the !KVM ifdef in target-ppc/kvm_ppc.h. However no such function exists on the KVM side, or is ever used. I think this originally referenced a function which read host page size information from /proc, for we we now use the KVM GET_SMMU_INFO extension instead. In any cas

[Qemu-devel] [PATCH 04/10] target-ppc: Rework SLB page size lookup

2016-01-24 Thread David Gibson
Currently, the ppc_hash64_page_shift() function looks up a page size based on information in an SLB entry. It open codes the bit translation for existing CPUs, however different CPU models can have different SLB encodings. We already store those in the 'sps' table in CPUPPCState, but we don't cur

[Qemu-devel] [PATCH 09/10] target-ppc: Helper to determine page size information from hpte alone

2016-01-24 Thread David Gibson
h_enter() in the spapr code needs to know the page size of the HPTE it's about to insert. Unlike other paths that do this, it doesn't have access to the SLB, so at the moment it determines this with some open-coded tests which assume POWER7 or POWER8 page size encodings. To make this more flexibl

[Qemu-devel] [PATCH 05/10] target-ppc: Use actual page size encodings from HPTE

2016-01-24 Thread David Gibson
At present the 64-bit hash MMU code uses information from the SLB to determine the page size of a translation. We do need that information to correctly look up the hash table. However the MMU also allows a possibly larger page size to be encoded into the HPTE itself, which is used to populate the

[Qemu-devel] [PATCH 06/10] target-ppc: Remove unused mmu models from ppc_tlb_invalidate_one

2016-01-24 Thread David Gibson
ppc_tlb_invalidate_one() has a big switch handling many different MMU types. However, most of those branches can never be reached: It is called from 3 places: from remove_hpte() and h_protect() in spapr_hcall.c (which always has a 64-bit hash MMU type), and from helper_tlbie() in mmu_helper.c. C

[Qemu-devel] [PATCH 02/10] target-ppc: Convert mmu-hash{32, 64}.[ch] from CPUPPCState to PowerPCCPU

2016-01-24 Thread David Gibson
Like a lot of places these files include a mixture of functions taking both the older CPUPPCState *env and newer PowerPCCPU *cpu. Move a step closer to cleaning this up by standardizing on PowerPCCPU, except for the helper_* functions which are called with the CPUPPCState * from tcg. Callers and

[Qemu-devel] [PATCH 08/10] target-ppc: Add new TLB invalidate by HPTE call for hash64 MMUs

2016-01-24 Thread David Gibson
When HPTEs are removed or modified by hypercalls on spapr, we need to invalidate the relevant pages in the qemu TLB. Currently we do that by doing some complicated calculations to work out the right encoding for the tlbie instruction, then passing that to ppc_tlb_invalidate_one()... which totally

[Qemu-devel] [PATCH 07/10] target-ppc: Split 44x tlbiva from ppc_tlb_invalidate_one()

2016-01-24 Thread David Gibson
Currently both the tlbiva instruction (used on 44x chips) and the tlbie instruction (used on hash MMU chips) are both handled via ppc_tlb_invalidate_one(). This is silly, because they're invoked from different places, and do different things. Clean this up by separating out the tlbiva instruction

[Qemu-devel] [PATCH 10/10] target-ppc: Allow more page sizes for POWER7 & POWER8 in TCG

2016-01-24 Thread David Gibson
Now that the TCG and spapr code has been extended to allow (semi-) arbitrary page encodings in the CPU's 'sps' table, we can add the many page sizes supported by real POWER7 and POWER8 hardware that we previously didn't support in TCG. Signed-off-by: David Gibson --- target-ppc/mmu-hash64.h

Re: [Qemu-devel] [PATCH RFC 6/7] net/filter: Add a default filter to each netdev

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > We add each netdev a default buffer filter, which the name is > 'nop', and the default buffer filter is disabled, so it has > no side effect for packets delivering in qemu net layer. > > The default buffer filter can be used by COLO or Micro-checkpoi

[Qemu-devel] [PATCH 00/10] Clean up page size handling for ppc 64-bit hash MMUs with TCG

2016-01-24 Thread David Gibson
Encoding of page sizes on 64-bit hash MMUs for Power is rather arcane, involving control bits in both the SLB and HPTE. At present we support a few of the options, but far fewer than real hardware. We're able to get away with that in practice, because guests use a device tree property to determin

Re: [Qemu-devel] [PATCH RFC 5/7] filter-buffer: Accept zero interval

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > We may want to accept zero interval when VM FT solutions like MC > or COLO use this filter to release packets on demand. > > Signed-off-by: zhanghailiang > Reviewed-by: Yang Hongyang > --- > net/filter-buffer.c | 10 -- > 1 file changed, 1

Re: [Qemu-devel] [PATCH RFC 4/7] net/filter: Introduce a helper to add a filter to the netdev

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > Signed-off-by: zhanghailiang Commit log please. > --- > include/net/filter.h | 5 + > net/filter.c | 63 > > 2 files changed, 68 insertions(+) > > diff --git a/include/net/filter.

Re: [Qemu-devel] [PATCH RFC 0/7] Netfilter: Add each netdev a default filter

2016-01-24 Thread Hailiang Zhang
On 2016/1/25 9:59, Hailiang Zhang wrote: On 2016/1/22 18:38, Daniel P. Berrange wrote: On Fri, Jan 22, 2016 at 06:35:48PM +0800, Hailiang Zhang wrote: On 2016/1/22 18:07, Daniel P. Berrange wrote: On Fri, Jan 22, 2016 at 04:36:44PM +0800, zhanghailiang wrote: This series is a prerequisite for

Re: [Qemu-devel] [PATCH RFC 7/7] net/filter: prevent the default filter to be deleted

2016-01-24 Thread Jason Wang
On 01/22/2016 04:36 PM, zhanghailiang wrote: > Signed-off-by: zhanghailiang > --- > net/filter.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/net/filter.c b/net/filter.c > index a126a3b..4aafff0 100644 > --- a/net/filter.c > +++ b/net/filter.c > @@ -323,11 +323,19 @@ static

[Qemu-devel] Migrating decrementer (was: Re: [PATCH 4/4] target-ppc: ensure we include the decrementer value during migration)

2016-01-24 Thread Mark Cave-Ayland
On 18/01/16 04:51, David Gibson wrote: > On Fri, Jan 15, 2016 at 05:46:10PM +, Mark Cave-Ayland wrote: >> On 12/01/16 02:44, David Gibson wrote: >> > In other words, isn't this just skipping the decrementer interrupts at > the qemu level rather than the guest level? > > It seem

Re: [Qemu-devel] [PATCH RFC 0/7] Netfilter: Add each netdev a default filter

2016-01-24 Thread Hailiang Zhang
On 2016/1/25 11:32, Jason Wang wrote: On 01/22/2016 06:07 PM, Daniel P. Berrange wrote: On Fri, Jan 22, 2016 at 04:36:44PM +0800, zhanghailiang wrote: This series is a prerequisite for COLO, here we add each netdev a default buffer filter, it is disabled by default, and has no side effect for

Re: [Qemu-devel] [PATCH RFC 1/7] net/filter: Fix the output information for command 'info network'

2016-01-24 Thread Hailiang Zhang
On 2016/1/25 13:01, Jason Wang wrote: On 01/22/2016 04:36 PM, zhanghailiang wrote: The properties of netfilter object could be changed by 'qom-set' command, but the output of 'info network' command is not updated, because it got the old information through nf->info_str, it will not be updated

Re: [Qemu-devel] [PATCH RFC 3/7] net/filter: Skip the disabled filter when delivering packets

2016-01-24 Thread Hailiang Zhang
On 2016/1/25 13:04, Jason Wang wrote: On 01/22/2016 05:32 PM, Wen Congyang wrote: On 01/22/2016 04:36 PM, zhanghailiang wrote: If the filter is disabled, don't go through it. Signed-off-by: zhanghailiang --- include/net/filter.h | 5 + net/net.c| 4 2 files changed,

  1   2   >