[Qemu-devel] [PULL 0/8] QOM CPUState patch queue 2015-10-22

2015-10-22 Thread Andreas Färber
Hello Peter, This is my QOM CPU patch queue. Please pull. Remaining maintainers should've had more than enough time to object or ack now. Regards, Andreas Cc: Peter Maydell Cc: Peter Crosthwaite The following changes since commit ca3e40e233e87f7b29442311736a82da01c0df7b: Merge remote-tra

[Qemu-devel] [PULL 8/8] disas: QOMify alpha specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() alpha specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. This also makes monitor_disas() consistent with target_disas(), as monitor_disas() was missing a set of the BFD (This was an omission from commit

[Qemu-devel] [PULL 2/8] disas: QOMify moxie specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() moxie specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Cc: Anthony Green Signed-off-by: Peter Crosthwaite Signed-off-by: Andreas Färber --- disas.c| 6 -- target-moxie/cpu.c | 7 ++

[Qemu-devel] [PULL 7/8] disas: QOMify mips specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() mips specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Cc: Aurelien Jarno Signed-off-by: Peter Crosthwaite Acked-by: Leon Alrae Signed-off-by: Andreas Färber --- disas.c | 12 ---

[Qemu-devel] [PULL 3/8] disas: QOMify m68k specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() m68k specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Signed-off-by: Peter Crosthwaite Reviewed-by: Laurent Vivier Reviewed-by: Greg Ungerer Signed-off-by: Andreas Färber --- disas.c |

[Qemu-devel] [PULL 5/8] disas: QOMify lm32 specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() lm32 specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Signed-off-by: Peter Crosthwaite Acked-by: Michael Walle Signed-off-by: Andreas Färber --- disas.c | 6 -- target-lm32/cpu.c | 7

[Qemu-devel] [PULL 4/8] disas: QOMify sparc specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() sparc specifics to the QOM disas_set_info hook and delete the #ifdef specific code in disas.c. Cc: Mark Cave-Ayland Signed-off-by: Peter Crosthwaite Signed-off-by: Andreas Färber --- disas.c| 10 -- target-sparc/cpu.c | 9 +

[Qemu-devel] [PULL 6/8] disas: QOMify sh4 specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() sh4 specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Signed-off-by: Peter Crosthwaite Acked-by: Aurelien Jarno Signed-off-by: Andreas Färber --- disas.c | 6 -- target-sh4/cpu.c | 11

[Qemu-devel] [PULL 1/8] disas: QOMify s390x specific disas setup

2015-10-22 Thread Andreas Färber
From: Peter Crosthwaite Move the target_disas() s390 specifics to the CPUClass::disas_set_info() hook and delete the #ifdef specific code in disas.c. Cc: Alexander Graf Signed-off-by: Peter Crosthwaite Acked-by: Richard Henderson Signed-off-by: Andreas Färber --- disas.c| 6

Re: [Qemu-devel] [PATCH 2/4] ide/atapi: blk_aio_readv may return NULL

2015-10-22 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:23PM +0200, Peter Lieven wrote: > Signed-off-by: Peter Lieven > --- > hw/ide/atapi.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c > index 2271ea2..e0cf066 100644 > --- a/hw/ide/atapi.c > +++ b/hw/ide/atapi.c > @@ -429,

Re: [Qemu-devel] [PATCH 1/4] ide/atapi: make PIO read requests async

2015-10-22 Thread Stefan Hajnoczi
On Mon, Oct 12, 2015 at 02:27:22PM +0200, Peter Lieven wrote: > @@ -129,9 +134,71 @@ static int cd_read_sector(IDEState *s, int lba, uint8_t > *buf, int sector_size) > ret = -EIO; > break; > } > + > +if (!ret) { > +s->lba++; This function probably shouldn't take

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Alex Williamson
On Thu, 2015-10-22 at 18:58 +0300, Or Gerlitz wrote: > On Wed, Oct 21, 2015 at 10:20 PM, Alex Williamson > wrote: > > > This is why the typical VF agnostic approach here is to using bonding > > and fail over to a emulated device during migration, so performance > > suffers, but downtime is someth

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Paolo Bonzini
On 22/10/2015 18:02, Eric Blake wrote: > On 10/22/2015 09:31 AM, Paolo Bonzini wrote: > >> Only if your machine cannot do unaligned loads. If it can, you can >> align the length instead of the buffer. memcmp will take care of >> aligning the buffer (with some luck it won't have to, e.g. if buf

Re: [Qemu-devel] [PATCH v7 03/14] qapi: Provide nicer array names in introspection

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > For the sake of humans reading introspection output, it is nice > to have the name of implicit array types be recognizable as > arrays of the underlying type. However, while this patch allows > humans to skip from a command with return type "[123]" straight > to the definiti

Re: [Qemu-devel] configure claims I requested feature nettle when I didn't...

2015-10-22 Thread Daniel P. Berrange
On Thu, Oct 22, 2015 at 05:09:14PM +0100, Peter Maydell wrote: > On 22 October 2015 at 16:43, Daniel P. Berrange wrote: > > Yes, if configure finds gnutls, it tries to figure out if gnutls > > links to nettle or gcrypt, and then checks for the corresponding > > one. It fails if gnutls is found, b

[Qemu-devel] [PATCH v3 9/9] kvm/x86: Hyper-V kvm exit

2015-10-22 Thread Andrey Smetanin
A new vcpu exit is introduced to notify the userspace of the changes in Hyper-V SynIC configuration triggered by guest writing to the corresponding MSRs. Changes v3: * added KVM_EXIT_HYPERV types and structs notes into docs Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by:

[Qemu-devel] [PATCH v3 8/9] kvm/x86: Hyper-V synthetic interrupt controller

2015-10-22 Thread Andrey Smetanin
SynIC (synthetic interrupt controller) is a lapic extension, which is controlled via MSRs and maintains for each vCPU - 16 synthetic interrupt "lines" (SINT's); each can be configured to trigger a specific interrupt vector optionally with auto-EOI semantics - a message page in the guest mem

Re: [Qemu-devel] configure claims I requested feature nettle when I didn't...

2015-10-22 Thread Peter Maydell
On 22 October 2015 at 16:43, Daniel P. Berrange wrote: > Yes, if configure finds gnutls, it tries to figure out if gnutls > links to nettle or gcrypt, and then checks for the corresponding > one. It fails if gnutls is found, but the corresponding nettle/gcrypt > is not found, on the basis that th

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Eric Blake
On 10/22/2015 09:31 AM, Paolo Bonzini wrote: > Only if your machine cannot do unaligned loads. If it can, you can > align the length instead of the buffer. memcmp will take care of > aligning the buffer (with some luck it won't have to, e.g. if buf is > 0x12340002 and length = 4094). On x86 una

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Or Gerlitz
On Wed, Oct 21, 2015 at 10:20 PM, Alex Williamson wrote: > This is why the typical VF agnostic approach here is to using bonding > and fail over to a emulated device during migration, so performance > suffers, but downtime is something acceptable. bonding in the VM isn't a zero touch solution, r

Re: [Qemu-devel] [PATCH v7 01/14] qapi: Use generated TestStruct machinery in tests

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > Commit d88f5fd and friends first introduced the various test-qmp-* > tests in 2011, with duplicated hand-rolled TestStruct machinery, > to make sure the qapi visitor interface was tested. Later, commit > 4f193e3 in 2013 added a .json file for further testing use by the > fil

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Eric Blake
[adding qemu] On 10/22/2015 08:00 AM, Pádraig Brady wrote: > * src/system.h (is_nul): Reimplement with a version > that doesn't require a sentinel after the buffer, > and which calls down to (the system optimized) memcmp. > Performance analyzed at http://rusty.ozlabs.org/?p=560 > /* Return wheth

Re: [Qemu-devel] [PATCH v9 08/17] tests: Convert to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > We have two issues with our qapi union layout: > 1) Even though the QMP wire format spells the tag 'type', the > C code spells it 'kind', requiring some hacks in the generator. > 2) The C struct uses an anonymous union, which places all tag > values in the same namespace as a

[Qemu-devel] [RFC PATCH v3 0/4] GICv3 live migration support

2015-10-22 Thread Pavel Fedin
This series introduces support for GICv3 live migration. It is based on kernel API which is not released yet, therefore i post it as an RFC. Kernel patches which implement this functionality are: - [PATCH v5 0/7] KVM: arm64: Implement API for vGICv3 live migration http://www.spinics.net/lists/kv

[Qemu-devel] [PATCH v2 5/5] iotests: Add tests for the x-blockdev-del command

2015-10-22 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/139 | 408 + tests/qemu-iotests/139.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 414 insertions(+) create mode 100644 tests/qemu-iotests/139 create mode 100644 tests/qemu-io

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Bernhard Voelker
On 10/22/2015 05:17 PM, Pádraig Brady wrote: On 22/10/15 15:44, Paolo Bonzini wrote: On 22/10/2015 16:37, Eric Blake wrote: + /* Check first 16 bytes manually. */ + for (len = 0; len < 16; len++) +{ + if (! bufsize) +return true; + if (*p) +return false; +

Re: [Qemu-devel] [PULL 21/38] vhost: use a function for each call

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 04:09:30PM +0200, Laurent Desnogues wrote: > Hello, > > There are some errors with gcc 4.4.7 due to the use of an anonymous > union in VhostUserMsg in declarations with initialization. Please see > below. > > Thanks. I don't have this system: want to send a patch?

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Eric Blake
On 10/22/2015 09:47 AM, Bernhard Voelker wrote: >> Also I suspect the extra conditions involved in using longs >> for just the first 16 bytes would outweigh the benefits? >> I.E. the first simple loop probably breaks early, and if not >> has the added benefit of "priming the pumps" for the subsequ

Re: [Qemu-devel] [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-22 Thread Dotan Barak
I tested those patches on QEMU v2.3.0 and they work (i.e. it adds to ability for emulated device to work SR-IOV). However, when I based my model on newer version of QEMU (i.e. upstream) with the new SR-IOV patches from Knut, There is a failure (SR-IOV enable fails). Thanks Dotan > -Origina

Re: [Qemu-devel] [PATCH v9 16/17] qapi: Finish converting to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > We have two issues with our qapi union layout: > 1) Even though the QMP wire format spells the tag 'type', the > C code spells it 'kind', requiring some hacks in the generator. > 2) The C struct uses an anonymous union, which places all tag > values in the same namespace as a

Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address

2015-10-22 Thread Eric Blake
On 10/22/2015 06:10 AM, Markus Armbruster wrote: > > I believe we have these has_FOOs not because someone tried to minimize > confusion, but due to laziness: it was simpler to blindly generate the > has_FOO for every FOO. > > Since I don't think distinguishing "pointer argument omitted" from > "

[Qemu-devel] [PATCH v2 3/5] block: Add blk_get_refcnt()

2015-10-22 Thread Alberto Garcia
This function returns the reference count of a given BlockBackend. For convenience, it returns 0 if the BlockBackend pointer is NULL. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz --- block/block-backend.c | 5 + include/sysemu/block-backend.h | 1 + 2 files changed, 6 inser

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Paolo Bonzini
On 22/10/2015 17:47, Bernhard Voelker wrote: >> Note the above does break early if non zero detected in first 16 bytes. >> >> Also I suspect the extra conditions involved in using longs >> for just the first 16 bytes would outweigh the benefits? >> I.E. the first simple loop probably breaks early

Re: [Qemu-devel] [PATCH v9 15/17] tpm: Convert to new qapi union layout

2015-10-22 Thread Eric Blake
On 10/22/2015 08:19 AM, Markus Armbruster wrote: > Eric Blake writes: > >> We have two issues with our qapi union layout: >> 1) Even though the QMP wire format spells the tag 'type', the >> C code spells it 'kind', requiring some hacks in the generator. >> 2) The C struct uses an anonymous union,

[Qemu-devel] [PATCH v2 1/5] mirror: keep an extra reference to the target image during the job

2015-10-22 Thread Alberto Garcia
During the 'drive-mirror' operation the target image only has the monitor reference, therefore there's nothing that prevents its deletion using the 'x-blockdev-del' command before the block job has finished. Signed-off-by: Alberto Garcia --- block/mirror.c | 6 ++ 1 file changed, 6 insertion

Re: [Qemu-devel] [RFC Patch 06/12] IXGBEVF: Add self emulation layer

2015-10-22 Thread Alexander Duyck
On 10/22/2015 05:50 AM, Michael S. Tsirkin wrote: On Wed, Oct 21, 2015 at 01:58:19PM -0700, Alexander Duyck wrote: On 10/21/2015 09:37 AM, Lan Tianyu wrote: In order to restore VF function after migration, add self emulation layer to record regs' values during accessing regs. Signed-off-by: La

[Qemu-devel] [PATCH v2 0/5] Add 'x-blockdev-del' command

2015-10-22 Thread Alberto Garcia
Here's the new version of the blockdev-del command. The first change is that I renamed it to 'x-blockdev-del' as Markus suggested. I also extended the test cases, which should be way more robust now. This actually made me realize that there's tricky scenarios that require changes in other parts o

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Peter Zijlstra
On Thu, Oct 22, 2015 at 04:18:31PM +0200, Andrea Arcangeli wrote: > The risk of memory corruption is still zero no matter what happens > here, in the extremely rare case the app will get a SIGBUS or a That might still upset people, SIGBUS isn't something an app can really recover from. > I'm not

Re: [Qemu-devel] [PATCH 2/6] e1000: Trivial implementation of various MAC registers

2015-10-22 Thread Leonid Bloch
On Thu, Oct 22, 2015 at 10:19 AM, Jason Wang wrote: > > > > On 10/21/2015 05:13 PM, Leonid Bloch wrote: > > Hi Jason, thanks for the review! > > > > On Tue, Oct 20, 2015 at 8:40 AM, Jason Wang wrote: > >> > >> > >> On 10/18/2015 03:53 PM, Leonid Bloch wrote: > >>> These registers appear in Intel'

Re: [Qemu-devel] [PATCH v9 00/17] qapi collision reduction (post-introspection subset B')

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > Pending prerequisite: Markus' qapi-next branch (which has the first > half of my subset B patches): > git://repo.or.cz/qemu/armbru.git pull-qapi-2015-10-15 > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg03321.html > > Pending prerequisite: Paolo's rewrite of qemu-

[Qemu-devel] [RFC PATCH v3 3/4] hw/intc/arm_gicv3_kvm: Implement get/put functions

2015-10-22 Thread Pavel Fedin
This actually implements pre_save and post_load methods for in-kernel vGICv3. Signed-off-by: Pavel Fedin --- hw/intc/arm_gicv3_kvm.c | 456 +++- 1 file changed, 452 insertions(+), 4 deletions(-) diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3

[Qemu-devel] [RFC PATCH v3 4/4] hw/intc/arm_gicv3_common: Add vmstate descriptors

2015-10-22 Thread Pavel Fedin
Add state structure descriptors and actually enable live migration. In order to describe fixed-size bitmaps, VMSTATE_BITMAP_STATIC() macro is introduced. Signed-off-by: Pavel Fedin --- hw/intc/arm_gicv3_common.c | 58 - include/migration/vmstate.h |

Re: [Qemu-devel] [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 02:22:12PM +, Dotan Barak wrote: > I tested those patches on QEMU v2.3.0 and they work > (i.e. it adds to ability for emulated device to work SR-IOV). > > However, when I based my model on newer version of QEMU (i.e. upstream) with > the new SR-IOV patches from Knut, >

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Pádraig Brady
On 22/10/15 15:44, Paolo Bonzini wrote: > > > On 22/10/2015 16:37, Eric Blake wrote: + /* Check first 16 bytes manually. */ + for (len = 0; len < 16; len++) +{ + if (! bufsize) +return true; + if (*p) +return false; + p

[Qemu-devel] [PATCH v2 4/5] block: Add 'x-blockdev-del' QMP command

2015-10-22 Thread Alberto Garcia
This command is still experimental, hence the name. This is the companion to 'blockdev-add'. It allows deleting a BlockBackend with its associated BlockDriverState tree, or a BlockDriverState that is not attached to any backend. In either case, the command fails if the reference count is greater

Re: [Qemu-devel] DO_UPCAST confusion

2015-10-22 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 22/10/2015 15:55, Eric Blake wrote: > Or maybe container_of_first(), to make it obvious that the parent > class is the first member. > > But how often does it really matter whether the container of the > parent class had the parent as the first

Re: [Qemu-devel] DO_UPCAST confusion

2015-10-22 Thread Eric Blake
On 10/22/2015 06:00 AM, Markus Armbruster wrote: > Peter Maydell writes: > >> On 21 October 2015 at 23:49, Eric Blake wrote: >>> I much prefer the name container_of() (which is a bit more obvious that >>> it is finding the container or derived type that embeds the parent >>> type), but if we hav

[Qemu-devel] [RFC PATCH v3 2/4] kernel: Add definitions for GICv3 attributes

2015-10-22 Thread Pavel Fedin
This temporary patch adds kernel API definitions. Use proper header update procedure after these features are released. Signed-off-by: Pavel Fedin --- linux-headers/asm-arm64/kvm.h | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/linux-headers/asm-arm64/kvm.

Re: [Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout

2015-10-22 Thread Eric Blake
On 10/22/2015 07:54 AM, Markus Armbruster wrote: > > This is clever and ugly in equal measure. I respect that. Fortunately, > it's also temporary. > >> Flat unions do not need the anonymous union for the tag member, >> as we already fixed that to use the member name instead of 'kind' >> back i

[Qemu-devel] [PATCH v2 2/5] backup: keep an extra reference to the target image during the job

2015-10-22 Thread Alberto Garcia
During the 'drive-backup' operation the target image only has the monitor reference, therefore there's nothing that prevents its deletion using the 'x-blockdev-del' command before the block job has finished. Although the operation itself does not allow the user to set a node name that can be used

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Andrea Arcangeli
On Thu, Oct 22, 2015 at 05:15:09PM +0200, Peter Zijlstra wrote: > Indefinitely is such a long time, we should try and finish > computation before the computer dies etc. :-) Indefinitely as read_seqcount_retry, eventually it makes progress. Even returning 0 from the page fault can trigger it again

Re: [Qemu-devel] [PATCH v9 08/17] tests: Convert to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > On 10/22/2015 08:01 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> We have two issues with our qapi union layout: >>> 1) Even though the QMP wire format spells the tag 'type', the >>> C code spells it 'kind', requiring some hacks in the generator. >>> 2) The C st

[Qemu-devel] configure claims I requested feature nettle when I didn't...

2015-10-22 Thread Peter Maydell
[pm215@gcc1-power7 all]$ ../../configure ERROR: User requested feature nettle configure was not able to find it. Install nettle devel ...but as you can see I didn't ask for nettle explicitly at all, so configure should fall back to disabling it, not exiting with an error. configure

Re: [Qemu-devel] [PATCH] qapi-schema: mark InetSocketAddress as mandatory again

2015-10-22 Thread Eric Blake
On 10/22/2015 06:42 AM, Daniel P. Berrange wrote: >>> +++ b/qapi-schema.json >>> @@ -2614,9 +2614,7 @@ >>> # >>> # @host: host part of the address >>> # >>> -# @port: port part of the address, or lowest port if @to is present. >>> -#Kernel selects a free port if omitted for listener add

Re: [Qemu-devel] configure claims I requested feature nettle when I didn't...

2015-10-22 Thread Daniel P. Berrange
On Thu, Oct 22, 2015 at 04:17:10PM +0100, Peter Maydell wrote: > [pm215@gcc1-power7 all]$ ../../configure > ERROR: User requested feature nettle >configure was not able to find it. >Install nettle devel > > ...but as you can see I didn't ask for nettle explicitly at all, > so confi

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Paolo Bonzini
On 22/10/2015 17:17, Pádraig Brady wrote: >> > Nice trick indeed. On the other hand, the first 16 bytes are enough to >> > rule out 99.99% (number out of thin hair) of the non-zero blocks, so >> > that's where you want to optimize. Checking them an unsigned long at a >> > time, or fetching a fe

Re: [Qemu-devel] [PATCH] copy, dd: simplify and optimize NUL bytes detection

2015-10-22 Thread Paolo Bonzini
On 22/10/2015 16:37, Eric Blake wrote: >> > + /* Check first 16 bytes manually. */ >> > + for (len = 0; len < 16; len++) >> > +{ >> > + if (! bufsize) >> > +return true; >> > + if (*p) >> > +return false; >> > + p++; >> > + bufsize--; >> > +} >> > +

[Qemu-devel] [PATCH] fw_cfg: move internal function call docs to header file

2015-10-22 Thread Gabriel L. Somlo
Move documentation for fw_cfg functions internal to qemu from docs/specs/fw_cfg.txt to the fw_cfg.h header file, next to their prototype declarations, formatted as doc-comments. Suggested-by: Peter Maydell Cc: Laszlo Ersek Cc: Gerd Hoffmann Cc: Marc Marí Cc: Jordan Justen Cc: Paolo Bonzini C

Re: [Qemu-devel] [PATCH v4 2/2] enable multi-function hot-add

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 07:57:52PM +0800, Cao jin wrote: > Enable pcie device multifunction hot, just ensure the function 0 > added last, then driver will got the notification to scan all the > function in the slot. > > Signed-off-by: Cao jin > --- > hw/pci/pci.c | 29 +++

Re: [Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > We have two issues with our qapi union layout: > 1) Even though the QMP wire format spells the tag 'type', the > C code spells it 'kind', requiring some hacks in the generator. > 2) The C struct uses an anonymous union, which places all tag > values in the same namespace as a

Re: [Qemu-devel] [PATCH v9 07/17] qapi: Start converting to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > On 10/22/2015 07:54 AM, Markus Armbruster wrote: > >> >> This is clever and ugly in equal measure. I respect that. Fortunately, >> it's also temporary. >> >>> Flat unions do not need the anonymous union for the tag member, >>> as we already fixed that to use the member na

Re: [Qemu-devel] DO_UPCAST confusion

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > On 10/22/2015 06:00 AM, Markus Armbruster wrote: >> Peter Maydell writes: >> >>> On 21 October 2015 at 23:49, Eric Blake wrote: I much prefer the name container_of() (which is a bit more obvious that it is finding the container or derived type that embeds the par

[Qemu-devel] [RFC PATCH v3 1/4] hw/intc/arm_gicv3_common: Add state information

2015-10-22 Thread Pavel Fedin
Add state information to GICv3 object structure and implement arm_gicv3_common_reset(). Also, add some functions for registers which are not stored directly but simulated. State information includes not only pure GICv3 data, but also some legacy registers. This will be useful for implementing soft

Re: [Qemu-devel] [PULL 21/38] vhost: use a function for each call

2015-10-22 Thread Laurent Desnogues
Hello, There are some errors with gcc 4.4.7 due to the use of an anonymous union in VhostUserMsg in declarations with initialization. Please see below. Thanks. On Wed, Oct 21, 2015 at 12:27 PM, Michael S. Tsirkin wrote: > From: Marc-André Lureau > > Replace the generic vhost_call() by specific

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Andrea Arcangeli
On Thu, Oct 22, 2015 at 03:38:24PM +0200, Peter Zijlstra wrote: > On Thu, Oct 22, 2015 at 03:20:15PM +0200, Andrea Arcangeli wrote: > > > If schedule spontaneously wakes up a task in TASK_KILLABLE state that > > would be a bug in the scheduler in my view. Luckily there doesn't seem > > to be such

Re: [Qemu-devel] [PATCH v9 15/17] tpm: Convert to new qapi union layout

2015-10-22 Thread Markus Armbruster
Eric Blake writes: > We have two issues with our qapi union layout: > 1) Even though the QMP wire format spells the tag 'type', the > C code spells it 'kind', requiring some hacks in the generator. > 2) The C struct uses an anonymous union, which places all tag > values in the same namespace as a

Re: [Qemu-devel] [PATCH v9 08/17] tests: Convert to new qapi union layout

2015-10-22 Thread Eric Blake
On 10/22/2015 08:01 AM, Markus Armbruster wrote: > Eric Blake writes: > >> We have two issues with our qapi union layout: >> 1) Even though the QMP wire format spells the tag 'type', the >> C code spells it 'kind', requiring some hacks in the generator. >> 2) The C struct uses an anonymous union,

Re: [Qemu-devel] [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-22 Thread Knut Omang
On Thu, 2015-10-22 at 16:14 +0300, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 10:01:31AM +0200, Knut Omang wrote: > > This patch set implements generic support for SR/IOV as an > > extension to the > > core PCIe functionality, similar to the way other capabilities such > > as AER > > is im

Re: [Qemu-devel] [PATCH] i386/acpi: add _HID to processor nodes

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 03:34:46PM +0200, Matthias Lange wrote: > On 10/22/2015 03:02 PM, Michael S. Tsirkin wrote: > > On Thu, Oct 22, 2015 at 02:42:05PM +0200, Matthias Lange wrote: > >> On 10/22/2015 01:48 PM, Michael S. Tsirkin wrote: > >>> On Thu, Oct 22, 2015 at 12:38:11PM +0200, Matthias Lan

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Peter Zijlstra
On Thu, Oct 22, 2015 at 03:20:15PM +0200, Andrea Arcangeli wrote: > If schedule spontaneously wakes up a task in TASK_KILLABLE state that > would be a bug in the scheduler in my view. Luckily there doesn't seem > to be such a bug, or at least we never experienced it. Well, there will be a wakeup,

Re: [Qemu-devel] [PATCH] i386/acpi: add _HID to processor nodes

2015-10-22 Thread Matthias Lange
On 10/22/2015 03:02 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 02:42:05PM +0200, Matthias Lange wrote: >> On 10/22/2015 01:48 PM, Michael S. Tsirkin wrote: >>> On Thu, Oct 22, 2015 at 12:38:11PM +0200, Matthias Lange wrote: Processor nodes created via the acpi/aml framework curren

Re: [Qemu-devel] Coding style for errors

2015-10-22 Thread Lluís Vilanova
Markus Armbruster writes: > Lluís Vilanova writes: [...] >> So, is there any agreement on what should be used? If so, could that please >> be >> added to CODING_STYLE? > I think HACKING would be a better fit. What about this? (at the end of HACKING) Feel free to add references to other functio

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Andrea Arcangeli
On Thu, Oct 22, 2015 at 02:10:56PM +0200, Peter Zijlstra wrote: > On Thu, May 14, 2015 at 07:31:11PM +0200, Andrea Arcangeli wrote: > > @@ -255,21 +259,23 @@ int handle_userfault(struct vm_area_struct *vma, > > unsigned long address, > > * through poll/read(). > > */ > > __add_wait_q

Re: [Qemu-devel] [PATCH v6 0/4] pcie: Add support for Single Root I/O Virtualization

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 10:01:31AM +0200, Knut Omang wrote: > This patch set implements generic support for SR/IOV as an extension to the > core PCIe functionality, similar to the way other capabilities such as AER > is implemented. We are in soft freeze now so I'd rather defer this until 2.5 is o

[Qemu-devel] [PATCH] target-arm: Extract some external ARM CPU API

2015-10-22 Thread Pavel Fedin
Includes, which reside in target-arm, are very problematic to use from code which is considered target-independent by the build system (for example, hw/intc/something.c). It happens because they depend on config-target.h, which is unreachable in this case. This creates problems for example for GICv

Re: [Qemu-devel] [PATCH] i386/acpi: add _HID to processor nodes

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 02:42:05PM +0200, Matthias Lange wrote: > On 10/22/2015 01:48 PM, Michael S. Tsirkin wrote: > > On Thu, Oct 22, 2015 at 12:38:11PM +0200, Matthias Lange wrote: > >> Processor nodes created via the acpi/aml framework currently don't > >> feature a _HID string. This patch appe

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Alex Williamson
On Thu, 2015-10-22 at 15:32 +0300, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 01:20:27PM -0600, Alex Williamson wrote: > > The trouble here is that the VF needs to be unplugged prior to the start > > of migration because we can't do effective dirty page tracking while the > > device is con

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 07:01:01AM -0600, Alex Williamson wrote: > On Thu, 2015-10-22 at 15:32 +0300, Michael S. Tsirkin wrote: > > On Wed, Oct 21, 2015 at 01:20:27PM -0600, Alex Williamson wrote: > > > The trouble here is that the VF needs to be unplugged prior to the start > > > of migration beca

Re: [Qemu-devel] What's the intended use of log.h logging?

2015-10-22 Thread Paolo Bonzini
On 22/10/2015 14:26, Stefan Hajnoczi wrote: > printk() - plain old printf > printk_once() - uses a static bool for once-only semantics, > modulo races between CPUs > printk_ratelimited() - time-based rate-limiting > > (And if you need to configure the ratelimit threshold, you can

Re: [Qemu-devel] [PATCH v6 2/4] pcie: Add support for Single Root I/O Virtualization (SR/IOV)

2015-10-22 Thread Dotan Barak
I have minor comments, to use the new helper functions. Thanks Dotan > -Original Message- > From: Knut Omang [mailto:knut.om...@oracle.com] > Sent: Thursday, October 22, 2015 11:02 AM > To: qemu-devel@nongnu.org > Cc: Paolo Bonzini ; Richard Henderson > ; Eduardo Habkost ; Michael S. > Ts

[Qemu-devel] [PATCH] i386/acpi: add _HID to processor nodes

2015-10-22 Thread Matthias Lange
Processor nodes created via the acpi/aml framework currently don't feature a _HID string. This patch appends "ACPI0007" as the _HID string to each processor node. Signed-off-by: Matthias Lange --- hw/i386/acpi-build.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/acpi-build.c b/hw/

Re: [Qemu-devel] [PATCH] i386/acpi: add _HID to processor nodes

2015-10-22 Thread Matthias Lange
On 10/22/2015 01:48 PM, Michael S. Tsirkin wrote: > On Thu, Oct 22, 2015 at 12:38:11PM +0200, Matthias Lange wrote: >> Processor nodes created via the acpi/aml framework currently don't >> feature a _HID string. This patch appends "ACPI0007" as the _HID >> string to each processor node. >> >> Signe

Re: [Qemu-devel] [RFC Patch 08/12] IXGBEVF: Rework code of finding the end transmit desc of package

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:40AM +0800, Lan Tianyu wrote: > When transmit a package, the end transmit desc of package > indicates whether package is sent already. Current code records > the end desc's pointer in the next_to_watch of struct tx buffer. > This code will be broken if shifting desc ri

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:32AM +0800, Lan Tianyu wrote: > This patchset is to propose a new solution to add live migration support for > 82599 > SRIOV network card. > > Im our solution, we prefer to put all device specific operation into VF and > PF driver and make code in the Qemu more gener

Re: [Qemu-devel] [RFC Patch 05/12] IXGBE: Add new sysfs interface of "notify_vf"

2015-10-22 Thread Michael S. Tsirkin
On Wed, Oct 21, 2015 at 01:52:48PM -0700, Alexander Duyck wrote: > Also have you even considered the MSI-X configuration on the VF? I haven't > seen anything anywhere that would have migrated the VF's MSI-X configuration > from BAR 3 on one system to the new system. Hypervisors do this for virtua

Re: [Qemu-devel] [RFC Patch 06/12] IXGBEVF: Add self emulation layer

2015-10-22 Thread Michael S. Tsirkin
On Wed, Oct 21, 2015 at 01:58:19PM -0700, Alexander Duyck wrote: > On 10/21/2015 09:37 AM, Lan Tianyu wrote: > >In order to restore VF function after migration, add self emulation layer > >to record regs' values during accessing regs. > > > >Signed-off-by: Lan Tianyu > >--- > > drivers/net/ethern

Re: [Qemu-devel] [RFC Patch 09/12] IXGBEVF: Add live migration support for VF driver

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:41AM +0800, Lan Tianyu wrote: > To let VF driver in the guest to know migration status, Qemu will > fake PCI configure reg 0xF0 and 0xF1 to show migrate status and > get ack from VF driver. I guess this works for current devices but not using 0xF0/0xF1 registers is no

Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address

2015-10-22 Thread Daniel P. Berrange
On Thu, Oct 22, 2015 at 02:10:26PM +0200, Markus Armbruster wrote: > Peter Maydell writes: > > > On 22 October 2015 at 10:43, Daniel P. Berrange wrote: > >> For reasons I don't understand, it appears that even string > >> fields which are marked as optional get a 'has_XXX' flag, > >> to distingu

Re: [Qemu-devel] [PATCH] qapi-schema: mark InetSocketAddress as mandatory again

2015-10-22 Thread Daniel P. Berrange
On Thu, Oct 22, 2015 at 06:22:29AM -0600, Eric Blake wrote: > On 10/22/2015 04:25 AM, Daniel P. Berrange wrote: > > Revert the qapi-schema.json change done in: > > > > commit 0983f5e6af76d5df8c6346cbdfff9d8305fb6da0 > > Author: Daniel P. Berrange > > Date: Tue Sep 1 14:46:50 2015 +0100 >

Re: [Qemu-devel] [RFC Patch 10/12] IXGBEVF: Add lock to protect tx/rx ring operation

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:42AM +0800, Lan Tianyu wrote: > Ring shifting during restoring VF function maybe race with original > ring operation(transmit/receive package). This patch is to add tx/rx > lock to protect ring related data. > > Signed-off-by: Lan Tianyu That's adding a bunch of loc

Re: [Qemu-devel] [RFC Patch 11/12] IXGBEVF: Migrate VF statistic data

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:43AM +0800, Lan Tianyu wrote: > VF statistic regs are read-only and can't be migrated via writing back > directly. > > Currently, statistic data returned to user space by the driver is not equal > to value of statistic regs. VF driver records value of statistic regs a

Re: [Qemu-devel] [PULL 00/38] vhost, pc, virtio features, fixes, cleanups

2015-10-22 Thread Peter Maydell
On 22 October 2015 at 12:40, Michael S. Tsirkin wrote: > On Wed, Oct 21, 2015 at 03:06:57PM +0100, Peter Maydell wrote: >> On 21 October 2015 at 11:26, Michael S. Tsirkin wrote: >> > The following changes since commit >> > 6d57410a79d51d92673c54f26624b44f27fa6214: >> > >> > Merge remote-tracki

Re: [Qemu-devel] [RFC Patch 00/12] IXGBE: Add live migration support for SRIOV NIC

2015-10-22 Thread Michael S. Tsirkin
On Wed, Oct 21, 2015 at 01:20:27PM -0600, Alex Williamson wrote: > The trouble here is that the VF needs to be unplugged prior to the start > of migration because we can't do effective dirty page tracking while the > device is connected and doing DMA. That's exactly what patch 12/12 is trying to a

Re: [Qemu-devel] [RFC Patch 12/12] IXGBEVF: Track dma dirty pages

2015-10-22 Thread Michael S. Tsirkin
On Thu, Oct 22, 2015 at 12:37:44AM +0800, Lan Tianyu wrote: > Migration relies on tracking dirty page to migrate memory. > Hardware can't automatically mark a page as dirty after DMA > memory access. VF descriptor rings and data buffers are modified > by hardware when receive and transmit data. To

Re: [Qemu-devel] What's the intended use of log.h logging? (was: [PATCH 2/3] log: report hmp/qmp command and qmp event)

2015-10-22 Thread Stefan Hajnoczi
On Wed, Oct 21, 2015 at 01:22:22PM +0100, Peter Maydell wrote: > On 21 October 2015 at 11:41, Stefan Hajnoczi wrote: > > DPRINTF() falls under both #1 and #2. Care needs to be taken to > > separate the logging from the tracing when converting DPRINTF(). > > > > Side note: we don't have effect "on

Re: [Qemu-devel] [PATCH] qapi-schema: mark InetSocketAddress as mandatory again

2015-10-22 Thread Eric Blake
On 10/22/2015 04:25 AM, Daniel P. Berrange wrote: > Revert the qapi-schema.json change done in: > > commit 0983f5e6af76d5df8c6346cbdfff9d8305fb6da0 > Author: Daniel P. Berrange > Date: Tue Sep 1 14:46:50 2015 +0100 > > sockets: allow port to be NULL when listening on IP address > >

Re: [Qemu-devel] [PATCH 0/6] qobject: Make conversion from QObject * accept null

2015-10-22 Thread Markus Armbruster
Luiz Capitulino writes: > On Thu, 15 Oct 2015 16:15:31 +0200 > Markus Armbruster wrote: > >> The qobject_to_FOO() crash on null, which is a trap for the unwary. >> Return null instead, and simplify a few callers. >> >> Throw in a patch to drop QObject_HEAD. >> >> Luiz, I'm happy to take this t

Re: [Qemu-devel] [PATCH 14/23] userfaultfd: wake pending userfaults

2015-10-22 Thread Peter Zijlstra
On Thu, May 14, 2015 at 07:31:11PM +0200, Andrea Arcangeli wrote: > @@ -255,21 +259,23 @@ int handle_userfault(struct vm_area_struct *vma, > unsigned long address, >* through poll/read(). >*/ > __add_wait_queue(&ctx->fault_wqh, &uwq.wq); > - for (;;) { > - set

Re: [Qemu-devel] [PATCH v2 03/16] sockets: allow port to be NULL when listening on IP address

2015-10-22 Thread Markus Armbruster
Peter Maydell writes: > On 22 October 2015 at 10:43, Daniel P. Berrange wrote: >> For reasons I don't understand, it appears that even string >> fields which are marked as optional get a 'has_XXX' flag, >> to distinguish betweeen a NULL string and an unset string. >> I struggle to imagine why we

Re: [Qemu-devel] DO_UPCAST confusion

2015-10-22 Thread Markus Armbruster
Peter Maydell writes: > On 21 October 2015 at 23:49, Eric Blake wrote: >> I much prefer the name container_of() (which is a bit more obvious that >> it is finding the container or derived type that embeds the parent >> type), but if we have to keep the ugly name, could we at least clean up >> th

<    1   2   3   4   >