[Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf

2014-11-08 Thread Willem Pinckaers
This is a simple patch to change the type of old_env from jmp_buf to sigjmp_buf. old_env is used by sigsetjmp and as such should be a sigjmp_buf. This fixes a stack_chk fail in a OSX 32bit build. Since at least on OSX sigjmp_buf is four bytes larger then a jmpbuf, resulting in an overflow in sig

Re: [Qemu-devel] [PATCH] coroutine-sigaltstack: Change jmp_buf to sigjmp_buf

2014-11-08 Thread Peter Maydell
On 8 November 2014 03:51, Willem Pinckaers wrote: > This is a simple patch to change the type of old_env from jmp_buf > to sigjmp_buf. old_env is used by sigsetjmp and as such should be > a sigjmp_buf. > > This fixes a stack_chk fail in a OSX 32bit build. Since at least on > OSX sigjmp_buf is fou

[Qemu-devel] [Bug 1385934] Re: USB with passthrougth guest cannot enumerate USB host

2014-11-08 Thread MikeFrysinger
the problem is this commit: http://git.qemu.org/?p=qemu.git;a=commit;h=b791c3b38c7969cb9f4acda8229e19fd865a1c08 it's easy to reproduce -- plug in a USB flash drive and try to pass it through on the host: $ lsusb Bus 003 Device 004: ID 1307:0163 Transcend Information, Inc. 256MB/512MB/1GB Flash D

Re: [Qemu-devel] [PATCH] linux-user: Do not subtract offset from end address

2014-11-08 Thread Andreas Färber
Am 06.11.2014 um 20:43 schrieb Tom Musta: > When computing the upper address of a program segment, do not subtract the > offset from the virtual address; instead compute the sum of the virtual > address > and the memory size. Note that this reads a bit weird as both old and new code are adding, n

[Qemu-devel] [PATCH 00/13] linux-aio/virtio-scsi: support AioContext wide IO submission as batch

2014-11-08 Thread Ming Lei
This patch implements AioContext wide IO submission as batch, and the idea behind is very simple: - linux native aio(io_submit) supports to enqueue read/write requests to different files - in one AioContext, I/O requests from VM can be submitted to different backen

[Qemu-devel] [PATCH 01/13] block/linux-aio: allocate io queue dynamically

2014-11-08 Thread Ming Lei
This patch allocates io queue dynamically so that we can support aio_context wide io queue in the following patch. Signed-off-by: Ming Lei --- block/linux-aio.c | 66 + 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/block/lin

[Qemu-devel] [PATCH 03/13] block/linux-aio: allocate 'struct qemu_laio_state' dynamically

2014-11-08 Thread Ming Lei
This patch allocates 'struct qemu_laio_state' in aio attach, and frees it in aio detach, so that in the following patch we can share one same instance of the structure among multiple linux-aio backend in same AioContext. Signed-off-by: Ming Lei --- block/linux-aio.c | 80 ++

[Qemu-devel] [PATCH 04/13] block/linux-aio: do more things in laio_state_alloc() and its pair

2014-11-08 Thread Ming Lei
Now lifetime of 'completion_bh', io queue and io context is same, so move their allocation into laio_state_alloc() and their releasing into laio_state_free(). Signed-off-by: Ming Lei --- block/linux-aio.c | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff

[Qemu-devel] [PATCH 02/13] block: linux-aio: rename 'ctx' of qemu_laiocb as 'laio_state'

2014-11-08 Thread Ming Lei
So that it can be distinguished from the 'ctx' in qemu_laio_state. Signed-off-by: Ming Lei --- block/linux-aio.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/linux-aio.c b/block/linux-aio.c index b9db28e..cf8691e 100644 --- a/block/linux-aio.c +++ b/block/

[Qemu-devel] [PATCH 07/13] block/linux-aio: support IO submission as batch in AioContext wide

2014-11-08 Thread Ming Lei
This patch supports IO submission as batch in AioContext wide by sharing 'struct qemu_laio_state' instance among all linux-aio backend in same AioContext. Signed-off-by: Ming Lei --- block/linux-aio.c | 36 ++-- 1 file changed, 34 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH 05/13] block/linux-aio: pass 'BlockDriverState' to laio_attach_aio_context and its pair

2014-11-08 Thread Ming Lei
This patch introduces parameter of 'BlockDriverState' to laio_attach_aio_context() and its pair, so that it will be easier to support IO submission as batch in AioContext wide. Signed-off-by: Ming Lei --- block/linux-aio.c |6 -- block/raw-aio.h |6 -- block/raw-posix.c |4

[Qemu-devel] [PATCH 08/13] block/linux-aio.c: allocate events dynamically

2014-11-08 Thread Ming Lei
This patch allocates events array of 'struct qemu_laio_state' dynamically so that in the following patch we can allocate resource elasticly in case of AioContext wide IO submission as batch. Signed-off-by: Ming Lei --- block/linux-aio.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[Qemu-devel] [PATCH 06/13] AioContext: introduce aio_attach_aio_bs() and its pair

2014-11-08 Thread Ming Lei
This patch introduces aio_attach_aio_bs() and its pair for supporting IO submission as batch in AioContext wide, and one typical use case is multi-lun SCSI. aio_attach_aio_bs() will attach one 'bs' which is capable of IO submission as batch, then all I/O submission in this AioContext will borrow t

[Qemu-devel] [PATCH 09/13] block/linux-aio.c: introduce laio_alloc_resource()

2014-11-08 Thread Ming Lei
This patch introduces laio_alloc_resource() for allocating resources for linux aio, then in the following patchs we can allocate IO resources just in demand. Signed-off-by: Ming Lei --- block/linux-aio.c | 55 ++--- 1 file changed, 35 insertions(

[Qemu-devel] [PATCH 12/13] block: introduce bdrv_aio_io_plug() and its pair

2014-11-08 Thread Ming Lei
These two APIs are introduced for using AioContext wide IO submission as batch. Signed-off-by: Ming Lei --- block.c | 16 include/block/block.h |3 +++ 2 files changed, 19 insertions(+) diff --git a/block.c b/block.c index dacd881..0200af0 100644 --- a/block

[Qemu-devel] [PATCH 11/13] block/linux-aio: reallocate I/O resources when aio attached

2014-11-08 Thread Ming Lei
First event notifier and qemu BH is associated with aio context, so it should be reallocated for making these handlers running in the current attached aio context. Secondly when new 'bs' is attached, we need to allocate more io resources for performance purpose. This patch only does the reallocat

[Qemu-devel] [PATCH 10/13] block/linux-aio.c: prepare for elastical resource's allocation

2014-11-08 Thread Ming Lei
Because we will support AioContext wide IO submission as batch, so IO resources should be allocated according to how many there are backends in the same AioContext. Signed-off-by: Ming Lei --- block/linux-aio.c | 38 +++--- 1 file changed, 31 insertions(+), 7 de

[Qemu-devel] [PATCH 13/13] virtio-scsi-dataplane: support AioContext wide IO submission as batch

2014-11-08 Thread Ming Lei
Replace previous usage with AioContext Wide approach. Signed-off-by: Ming Lei --- hw/scsi/virtio-scsi-dataplane.c |8 hw/scsi/virtio-scsi.c |2 -- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-datap