Re: [Qemu-devel] [PATCH v2 00/11] cpu: add i386 cpu hot remove support

2015-02-05 Thread Zhu Guihua
On Tue, 2015-02-03 at 16:41 +0800, Zhi Yong Wu wrote: > HI, > > Can you push the patchset to a branch on github? It will be convenient > for other guys to do some tests. sorry for late reply. I had pushed into https://github.com/zhugh/qemu.git The patchset is on branch cpu-hotplug. Welcome to te

[Qemu-devel] [PATCH 5/5] virtio-pci: introduce auto_msix_bar_size property

2015-02-05 Thread Jason Wang
This patch introduces boolean auto_msix_bar_size property for virito-pci devices. Enable this will let the device calculate the msix bar size based on the number of MSI-X entries instead of previous 4096 hard-coded limit. This is a must to let virtio-net can up to 256 queues and each queue were as

[Qemu-devel] [PATCH 1/5] virtio: rename VIRTIO_PCI_QUEUE_MAX to VIRTIO_QUEUE_MAX

2015-02-05 Thread Jason Wang
VIRTIO_PCI_QUEUE_MAX was not specific to pci, so rename it to VIRTIO_QUEUE_MAX. Cc: Amit Shah Cc: Anthony Liguori Cc: Michael S. Tsirkin Cc: Alexander Graf Cc: Richard Henderson Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Paolo Bonzini Signed-off-by: Jason Wang --- hw/char/virtio-ser

[Qemu-devel] [PATCH 4/5] pci: remove hard-coded bar size in msix_init_exclusive_bar()

2015-02-05 Thread Jason Wang
Let msix_init_exclusive_bar() can accept bar_size parameter other than a hard-coded limit 4096. Then caller can specify a bar_size depends on msix entries and can use up to 2048 msix entries as PCI spec allows. To keep migration compatibility, 4096 is used for all callers and pba were start from ha

[Qemu-devel] [PATCH 3/5] virtio-net: fix the upper bound when trying to delete queues

2015-02-05 Thread Jason Wang
Virtqueue were indexed from zero, so don't delete virtqueue whose index is n->max_queues * 2 + 1. Cc: Anthony Liguori Cc: Michael S. Tsirkin Signed-off-by: Jason Wang --- hw/net/virtio-net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio

[Qemu-devel] [PATCH 2/5] virtio: increase VIRITO_QUEUE_MAX to 513

2015-02-05 Thread Jason Wang
Recent linux kernel supports up to 256 tap queues. Increase the limit to 513 (256 * 2 + 1(ctrl vq)). Signed-off-by: Jason Wang --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 220c09d.

[Qemu-devel] [PATCH 0/5] Support more virtio queues

2015-02-05 Thread Jason Wang
We current limit the max virtio queues to 64. This is not sufficient to support some multiqueue deivces (e.g recent Linux support up to 256 tap queues). So this series try to let virtio to support more queues. No much works needs to be done except: - Patch 1 renames VIRTIO_PCI_QUEUE_MAX to a more

Re: [Qemu-devel] [RFC v2 4/8] vfio-pci: pass the aer error to guest

2015-02-05 Thread Chen Fan
On 02/03/2015 04:16 AM, Alex Williamson wrote: On Wed, 2015-01-28 at 16:37 +0800, Chen Fan wrote: when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, the results in the qemu eventfd handler getting invoked.

Re: [Qemu-devel] [RFC v2 2/8] vfio-pci: add aer capability support

2015-02-05 Thread Chen Fan
On 02/03/2015 04:15 AM, Alex Williamson wrote: On Wed, 2015-01-28 at 16:37 +0800, Chen Fan wrote: if we detect the aer capability in vfio device, then we should initialize the vfio device aer rigister bits. so guest OS can set this bits as needed. s/rigister/register/ Signed-off-by: Chen Fan

Re: [Qemu-devel] Intel X86 hardware transactional memory

2015-02-05 Thread Richard Henderson
On 02/05/2015 07:36 PM, Xin Tong wrote: > I agree conflict detection should be down on physical addresses. we do > have physical addresses in the softmmu helpers. On a side note, is > there a plan to be provide a set of functionalities in QEMU to make > implementing transactional memory easier ? N

[Qemu-devel] [v2][RFC][PATCH] virtio: uniform virtio device IDs

2015-02-05 Thread Tiejun Chen
Actually we define these device IDs in virtio standard, so we'd better put them into one common place to manage conveniently. Here I also add VIRTIO_ID_RESERVE according to virtio spec. Signed-off-by: Tiejun Chen --- hw/9pfs/virtio-9p.h| 2 -- include/hw/virtio/virtio-balloon.h

Re: [Qemu-devel] [RFC][PATCH] virtio: uniform virtio device IDs

2015-02-05 Thread Chen, Tiejun
Sorry please ignore this to review another revision. Thanks Tiejun On 2015/2/6 13:24, Tiejun Chen wrote: Actually we define these device IDs in virtio standard, so we'd better put them into one common place to manage conveniently. Here I also add VIRTIO_ID_RESERVE according to virtio spec. Sig

Re: [Qemu-devel] [PATCH v3 6/7] cpu: add device_add foo-x86_64-cpu support

2015-02-05 Thread Chen Fan
On 01/30/2015 12:39 AM, Andreas Färber wrote: Am 29.01.2015 um 17:01 schrieb Eduardo Habkost: On Thu, Jan 29, 2015 at 03:46:03PM +0100, Igor Mammedov wrote: [...] @@ -2742,7 +2776,14 @@ static void x86_cpu_apic_create(X86CPU *cpu, Error **errp) object_property_add_child(OBJECT(cpu),

[Qemu-devel] [RFC][PATCH] virtio: uniform virtio device IDs

2015-02-05 Thread Tiejun Chen
Actually we define these device IDs in virtio standard, so we'd better put them into one common place to manage conveniently. Here I also add VIRTIO_ID_RESERVE according to virtio spec. Signed-off-by: Tiejun Chen --- hw/9pfs/virtio-9p.h| 2 -- include/hw/virtio/virtio-balloon.h

[Qemu-devel] undefined opcode exception for Intel RTM

2015-02-05 Thread Xin Tong
Intel Restricted Transactional Memory triggers an undefined opcode exception when EAX=7&EBX=0 [bit 11] is not set. I am wondering where one should check this to raise an EXCP06_ILLOP exception ? I think adding something to the hflags and check at translation time would be enough, would like to con

Re: [Qemu-devel] [PATCH v16 1/2] sPAPR: Implement EEH RTAS calls

2015-02-05 Thread Gavin Shan
On Fri, Feb 06, 2015 at 11:58:25AM +1100, David Gibson wrote: >On Thu, Feb 05, 2015 at 04:50:06PM +1100, Gavin Shan wrote: >> On Thu, Feb 05, 2015 at 02:19:49PM +1100, David Gibson wrote: >> >On Wed, Feb 04, 2015 at 01:27:35PM +1100, Gavin Shan wrote: >> >> The emulation for EEH RTAS requests from

[Qemu-devel] [PATCHv3 4/9] pseries: Add more parameter validation in RTAS time of day functions

2015-02-05 Thread David Gibson
Currently, the RTAS time of day functions only partially validate the number of parameters they receive and return. Because of how the parameters are used, this is unlikely to lead to a crash, but it's messy. This patch adds the missing checks. Signed-off-by: David Gibson --- hw/ppc/spapr_rtc.

[Qemu-devel] [PATCHv3 3/9] pseries: Move sPAPR RTC code into its own file

2015-02-05 Thread David Gibson
At the moment the RTAS (firmware/hypervisor) time of day functions are implemented in spapr_rtas.c along with a bunch of other things. Since we're going to be expanding these a bit, move the RTAS RTC related code out into new file spapr_rtc.c. Also add its own initialization function, spapr_rtc_i

[Qemu-devel] [PATCHv3 5/9] pseries: Add spapr_rtc_read() helper function

2015-02-05 Thread David Gibson
The virtual RTC time is used in two places in the pseries machine. First is in the RTAS get-time-of-day function which returns the RTC time to the guest. Second is in the spapr events code which is used to timestamp event messages from the hypervisor to the guest. Currently both call qemu_get_ti

[Qemu-devel] [PATCHv3 0/9] pseries: Fix and extend PAPR RTC implementation

2015-02-05 Thread David Gibson
At the moment, the PAPR RTC implementation (actually a paravirt firmware interface, rather than a normal device) works directly off host time, and so doesn't respect the options such as clock=vm which can be specified in the -rtc command line option. This series addresses those defects. The above

[Qemu-devel] [PATCHv3 7/9] pseries: Make the PAPR RTC a qdev device

2015-02-05 Thread David Gibson
At present the PAPR RTC isn't a "device" as such - it's accessed only via firmware/hypervisor calls, and is handled in the sPAPR core code. This becomes inconvenient as we extend it in various ways. This patch makes the PAPR RTC a separate device in the qemu device model. For now, the only piece

[Qemu-devel] [PATCHv3 8/9] pseries: Move rtc_offset into RTC device's state structure

2015-02-05 Thread David Gibson
The initial creation of the PAPR RTC qdev class left a wart - the rtc's offset was left in the sPAPREnvironment structure, accessed via a global. This patch moves it into the RTC device's own state structure, were it belongs. This requires a small change to the migration stream format. In order

[Qemu-devel] [PATCHv3 2/9] Add more VMSTATE_*_TEST variants for integers

2015-02-05 Thread David Gibson
Currently, vmstate.h includes helper macro variants for 8, 16 and 32-bit unsigned integers which include a "test" function which can selectively enable or disable the field's presence in the migration stream. There aren't similar helpers for 64-bit unsigned integers, or any size of signed integers

[Qemu-devel] [PATCHv3 1/9] Generalize QOM publishing of date and time from mc146818rtc.c

2015-02-05 Thread David Gibson
The mc146818rtc driver exposes the current RTC date and time via the "date" property in QOM (which is also aliased to the machine's "rtc-time" property). Currently it uses a custom visitor function rtc_get_date to do this. This patch introduces new helpers to the QOM core to expose struct tm valu

[Qemu-devel] [PATCHv3 6/9] pseries: Make RTAS time of day functions respect -rtc options

2015-02-05 Thread David Gibson
In the 'pseries' machine the real time clock is provided by a paravirtualized firmware interface rather than a device per se; the RTAS get-time-of-day and set-time-of-day calls. Out current implementations of those work directly off host time (with an offset), not respecting options such as clock=

[Qemu-devel] [PATCHv3 9/9] pseries: Export RTC time via QOM

2015-02-05 Thread David Gibson
On x86, the guest's RTC can be read with QMP, either from the RTC device's "date" property or via the "rtc-time" property on the machine (which is an alias to the former). This is set up in the mc146818rtc driver, and doesn't work on other targets. This patch adds a similar "date" property to the

Re: [Qemu-devel] Intel X86 hardware transactional memory

2015-02-05 Thread Xin Tong
On Thu, Feb 5, 2015 at 5:52 PM, Richard Henderson wrote: > On 02/04/2015 09:09 PM, Patrick Williams III wrote: >>>I think one possible way is to clear the software tlb on entry to the >>>transaction and disable (not install any translations) the software >>>TLB till the end of the transaction. >>>

Re: [Qemu-devel] Virtio Disk drivers and Microsoft clustering

2015-02-05 Thread Fam Zheng
On Thu, 02/05 15:29, massimo buscato wrote: > Hi all! > > About virtio-scsi driver: > There are many problem to use it on windows 2012 cluster service. > > Every time you try to validate a Virtio disk under W2012 cluster tool, > you have this errors: > > with VIRTIO DISK device: > "The port driv

[Qemu-devel] QEMU target-i386 decoding bug ?

2015-02-05 Thread Xin Tong
Is there a decoding bug here ? would not stgi and vmfunc both fall into the case 4: /* STGI */ ? And it seems case 4 is only handling STGI. // CHECK: stgi // CHECK: encoding: [0x0f,0x01,0xdc] // CHECK: vmfunc // CHECK: encoding: [0x0f,0x01,0xd4] case 2: /* lgdt */ case 3: /* lid

Re: [Qemu-devel] [PATCH v16 1/2] sPAPR: Implement EEH RTAS calls

2015-02-05 Thread David Gibson
On Thu, Feb 05, 2015 at 04:50:06PM +1100, Gavin Shan wrote: > On Thu, Feb 05, 2015 at 02:19:49PM +1100, David Gibson wrote: > >On Wed, Feb 04, 2015 at 01:27:35PM +1100, Gavin Shan wrote: > >> The emulation for EEH RTAS requests from guest isn't covered > >> by QEMU yet and the patch implements them

Re: [Qemu-devel] [RFC] pseries: Enable in-kernel H_LOGICAL_CI_{LOAD, STORE} implementations

2015-02-05 Thread David Gibson
On Thu, Feb 05, 2015 at 12:55:45PM +0100, Alexander Graf wrote: > > > On 05.02.15 12:30, David Gibson wrote: > > On Thu, Feb 05, 2015 at 11:22:13AM +0100, Alexander Graf wrote: [snip] > [snip] > > > +ret1 = kvmppc_enable_hcall(kvm_state, H_LOGICAL_CI_LOAD); > >>>

Re: [Qemu-devel] [PATCH v4] sheepdog: selectable object size support

2015-02-05 Thread Liu Yuan
On Wed, Feb 04, 2015 at 01:54:19PM +0900, Teruaki Ishizaki wrote: > (2015/02/02 15:52), Liu Yuan wrote: > >On Tue, Jan 27, 2015 at 05:35:27PM +0900, Teruaki Ishizaki wrote: > >>Previously, qemu block driver of sheepdog used hard-coded VDI object size. > >>This patch enables users to handle "block_s

Re: [Qemu-devel] Intel X86 hardware transactional memory

2015-02-05 Thread Richard Henderson
On 02/04/2015 09:09 PM, Patrick Williams III wrote: >>I think one possible way is to clear the software tlb on entry to the >>transaction and disable (not install any translations) the software >>TLB till the end of the transaction. >>In the softmmu helper functions, the memory addresses as well a

Re: [Qemu-devel] [PATCH v3 1/8] tcg: Move some opcode generation functions out of line

2015-02-05 Thread Richard Henderson
On 02/04/2015 02:12 PM, Bastian Koppelmann wrote: > I've got some weird trailing whitespace here, but maybe it's just my mail > client. I guess so; checkpatch doesn't see any on the actual patch. r~

Re: [Qemu-devel] [Xen-devel] [v2][PATCH] libxl: add one machine property to support IGD GFX passthrough

2015-02-05 Thread Chen, Tiejun
On 2015/2/5 17:52, Ian Campbell wrote: On Thu, 2015-02-05 at 09:22 +0800, Chen, Tiejun wrote: Indeed this is not something workaround, and I think in any type of VGA devices, we'd like to diminish this sort of thing gradually, right? This mightn't come true in real world :) It's not really so

Re: [Qemu-devel] [PATCH] blkdebug: fix "once" rule

2015-02-05 Thread John Snow
On 02/05/2015 06:43 PM, Max Reitz wrote: On 2015-02-05 at 18:15, John Snow wrote: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the

Re: [Qemu-devel] [PATCH] blkdebug: fix "once" rule

2015-02-05 Thread Max Reitz
On 2015-02-05 at 18:15, John Snow wrote: The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided the events and

[Qemu-devel] [PATCH] blkdebug: fix "once" rule

2015-02-05 Thread John Snow
The blkdebug scripts are currently engineered so that when a debug event occurs, a prefilter browses a master list of parsed rules for a certain event and adds them to an "active list" of rules to be used for the forthcoming action, provided the events and state numbers match. Then, once the reque

Re: [Qemu-devel] [PATCH v1] add intel restricted transactional memory test case.

2015-02-05 Thread Xin Tong
I am planning to implement support for Intel RTM. similar to what is done for PowerPC. we can default to fault (transaction abort) to the fallback code path. Would like to check in this test case first. On Thu, Feb 5, 2015 at 1:56 PM, wrote: > Add test case for intel restrict transactional memo

Re: [Qemu-devel] [PATCH v4 15/16] block: Remove "growable" from BDS

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Now that request clamping is done in the BlockBackend, the "growable" > field can be removed from the BlockDriverState. All BDSs are now treated > as being "growable" (that is, they are allowed to grow; they are not > necessarily actually able to). > > Si

[Qemu-devel] [PATCH v1] add intel restricted transactional memory test case.

2015-02-05 Thread trent . tong
Add test case for intel restrict transactional memory. compiled with Intel ICC 15.0 as well as GCC 4.8. This test case can be used to test intel RTM support in the target-i386 frontend. Signed-off-by: Xin Tong diff --git a/tests/tcg/test-intelrtm.c b/tests/tcg/test-intelrtm.c new file mode 10064

Re: [Qemu-devel] [PATCH v4 13/16] qemu-io: Use BlockBackend

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > qemu-io should behave like a guest, therefore it should use BlockBackend > to access the block layer. > > There are a couple of places where that is infeasible: First, the > bdrv_debug_* functions could theoretically be mirrored in the > BlockBackend, but

Re: [Qemu-devel] [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support

2015-02-05 Thread Junio C Hamano
Jeff King writes: > On Thu, Feb 05, 2015 at 11:29:07AM -0800, Junio C Hamano wrote: > >> Eric Blake writes: >> >> > On 02/05/2015 04:49 AM, Stefan Hajnoczi wrote: >> >> On Wed, Jan 14, 2015 at 03:27:23PM +0800, Zhu Guihua wrote: >> >>> This series is based on the previous patchset from Chen Fan

Re: [Qemu-devel] [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support

2015-02-05 Thread Junio C Hamano
Eric Blake writes: > On 02/05/2015 04:49 AM, Stefan Hajnoczi wrote: >> On Wed, Jan 14, 2015 at 03:27:23PM +0800, Zhu Guihua wrote: >>> This series is based on the previous patchset from Chen Fan: >>> https://lists.nongnu.org/archive/html/qemu-devel/2014-05/msg02360.html >> >> This email has an i

Re: [Qemu-devel] [PATCH v3 0/7] cpu: add device_add foo-x86_64-cpu support

2015-02-05 Thread Jeff King
On Thu, Feb 05, 2015 at 11:29:07AM -0800, Junio C Hamano wrote: > Eric Blake writes: > > > On 02/05/2015 04:49 AM, Stefan Hajnoczi wrote: > >> On Wed, Jan 14, 2015 at 03:27:23PM +0800, Zhu Guihua wrote: > >>> This series is based on the previous patchset from Chen Fan: > >>> https://lists.nongnu

Re: [Qemu-devel] [PATCH v4 12/16] qemu-io: Remove "growable" option

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Remove "growable" option from the "open" command and from the qemu-io > command line. qemu-io is about to be converted to BlockBackend which > will make sure that no request exceeds the image size, so the only way > to keep "growable" would be to use Block

Re: [Qemu-devel] [PATCH v4 11/16] qemu-io: Use blk_new_open() in openfile()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > qemu-io.c | 30 -- > 1 file changed, 12 insertions(+), 18 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://

Re: [Qemu-devel] [PATCH v4 09/16] qemu-img: Use BlockBackend as far as possible

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Although qemu-img already creates BlockBackends, it does not do accesses > to the images through them. This patch converts all of the bdrv_* calls > for which this is currently possible to blk_* calls. Most of the > remaining calls will probably stay bdrv_

Re: [Qemu-devel] [PATCH v4 07/16] qemu-img: Use blk_new_open() in img_open()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > qemu-img.c | 20 ++-- > 1 file changed, 6 insertions(+), 14 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.or

Re: [Qemu-devel] [PATCH v4 06/16] block/xen: Use blk_new_open() in blk_connect()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > As part of the required changes, this fixes a bug where specifying an > invalid driver would result in the block layer probing the image format; > now it will result in an error, unless "" is specified as the > driver name. Fixing this would require furthe

Re: [Qemu-devel] [PATCH v4 03/16] block: Add Error parameter to bdrv_find_protocol()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > The argument given to bdrv_find_protocol() is just a file name, which > makes it difficult for the caller to reconstruct what protocol > bdrv_find_protocol() was hoping to find. This patch adds an Error > parameter to that function to solve this issue. >

Re: [Qemu-devel] [PATCH v4 05/16] blockdev: Use blk_new_open() in blockdev_init()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Due to different error propagation, this breaks tests 051 and 087; fix > their output. > > Signed-off-by: Max Reitz > --- > blockdev.c | 92 > +- > tests/qemu-iotests/051.out | 62

Re: [Qemu-devel] [PATCH v4 04/16] iotests: Add test for driver=qcow2, format=qcow2

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > While specifying a different driver and format is obviously invalid, > specifying the same driver once through driver and once through format > is invalid as well. Add a test for it. > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/051 | 1 +

Re: [Qemu-devel] [PATCH v4 08/16] qemu-img: Use blk_new_open() in img_rebase()

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > qemu-img.c | 49 +++-- > 1 file changed, 23 insertions(+), 26 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualiza

Re: [Qemu-devel] [PATCH v4 01/16] block: Lift some BDS functions to the BlockBackend

2015-02-05 Thread Eric Blake
On 02/05/2015 11:58 AM, Max Reitz wrote: > Create the blk_* counterparts for the following bdrv_* functions (which > make sense to call on the BlockBackend level): > - bdrv_co_write_zeroes() > - bdrv_write_compressed() > - bdrv_truncate() > - bdrv_nb_sectors() > - bdrv_discard() > - bdrv_load_vmsta

Re: [Qemu-devel] [PATCH v2 10/12] qcow2/overlaps: Protect inactive L1 tables

2015-02-05 Thread Eric Blake
On 11/24/2014 08:56 AM, Max Reitz wrote: > Keep track of the inactive L1 tables in the metadata list to protect > them against accidental modifications. > > Signed-off-by: Max Reitz > --- > block/qcow2-snapshot.c | 25 + > 1 file changed, 25 insertions(+) > Reviewed-by:

Re: [Qemu-devel] [PATCH v2 1/1] Print PID and time in stderr traces

2015-02-05 Thread Dr. David Alan Gilbert
* Dr. David Alan Gilbert (git) (dgilb...@redhat.com) wrote: > From: "Dr. David Alan Gilbert" > > When debugging migration it's useful to know the PID of > each trace message so you can figure out if it came from the source > or the destination. > > Printing the time makes it easy to do latency m

[Qemu-devel] [PATCH v4 10/16] qemu-nbd: Use blk_new_open() in main()

2015-02-05 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- qemu-nbd.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 4d8df08..ac1e5d6 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -391,7 +391,6 @@ int main(int argc, char **arg

[Qemu-devel] [PATCH v4 14/16] block: Clamp BlockBackend requests

2015-02-05 Thread Max Reitz
BlockBackend is used as the interface between the block layer and guest devices. It should therefore assure that all requests are clamped to the image size. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- block/block-backend.c | 152

Re: [Qemu-devel] [PATCH v2 6/7] softfloat: Add SoftFloat status `nan2008_mode' flag

2015-02-05 Thread Maciej W. Rozycki
On Thu, 5 Feb 2015, Peter Maydell wrote: > > Index: qemu-git-trunk/fpu/softfloat-specialize.h > > === > > --- qemu-git-trunk.orig/fpu/softfloat-specialize.h 2014-12-11 > > 22:42:41.128934304 + > > +++ qemu-git-trunk/fpu/soft

[Qemu-devel] [PATCH v4 16/16] block: Keep bdrv_check*_request()'s return value

2015-02-05 Thread Max Reitz
Do not throw away the value returned by bdrv_check_request() and bdrv_check_byte_request(). Fix up some coding style issues in the proximity of the affected hunks. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- block.c | 35 --- 1

[Qemu-devel] [PATCH v4 11/16] qemu-io: Use blk_new_open() in openfile()

2015-02-05 Thread Max Reitz
Signed-off-by: Max Reitz --- qemu-io.c | 30 -- 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 91a445a..fa072df 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -51,34 +51,29 @@ static const cmdinfo_t close_cmd = { .oneline

[Qemu-devel] [PATCH v4 08/16] qemu-img: Use blk_new_open() in img_rebase()

2015-02-05 Thread Max Reitz
Signed-off-by: Max Reitz --- qemu-img.c | 49 +++-- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index a67688d..26fb3a1 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -2433,7 +2433,6 @@ static int img_rebase(int a

[Qemu-devel] [PATCH v4 12/16] qemu-io: Remove "growable" option

2015-02-05 Thread Max Reitz
Remove "growable" option from the "open" command and from the qemu-io command line. qemu-io is about to be converted to BlockBackend which will make sure that no request exceeds the image size, so the only way to keep "growable" would be to use BlockBackend if it is not given and to directly access

[Qemu-devel] [PATCH v4 02/16] block: Add blk_new_open()

2015-02-05 Thread Max Reitz
blk_new_with_bs() creates a BlockBackend with an empty BlockDriverState attached to it. Empty BDSs are not nice, therefore add an alternative function which combines blk_new_with_bs() with bdrv_open(). Note: In contrast to bdrv_open() which takes a BlockDriver parameter, blk_new_open() does not ta

[Qemu-devel] [PATCH v4 09/16] qemu-img: Use BlockBackend as far as possible

2015-02-05 Thread Max Reitz
Although qemu-img already creates BlockBackends, it does not do accesses to the images through them. This patch converts all of the bdrv_* calls for which this is currently possible to blk_* calls. Most of the remaining calls will probably stay bdrv_* calls because they really do operate on the BDS

[Qemu-devel] [PATCH v4 01/16] block: Lift some BDS functions to the BlockBackend

2015-02-05 Thread Max Reitz
Create the blk_* counterparts for the following bdrv_* functions (which make sense to call on the BlockBackend level): - bdrv_co_write_zeroes() - bdrv_write_compressed() - bdrv_truncate() - bdrv_nb_sectors() - bdrv_discard() - bdrv_load_vmstate() - bdrv_save_vmstate() Signed-off-by: Max Reitz ---

[Qemu-devel] [PATCH v4 15/16] block: Remove "growable" from BDS

2015-02-05 Thread Max Reitz
Now that request clamping is done in the BlockBackend, the "growable" field can be removed from the BlockDriverState. All BDSs are now treated as being "growable" (that is, they are allowed to grow; they are not necessarily actually able to). Signed-off-by: Max Reitz --- block.c

[Qemu-devel] [PATCH v4 07/16] qemu-img: Use blk_new_open() in img_open()

2015-02-05 Thread Max Reitz
Signed-off-by: Max Reitz --- qemu-img.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 7154055..a67688d 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -293,32 +293,24 @@ static BlockBackend *img_open(const char *id, const char

[Qemu-devel] [PATCH v4 06/16] block/xen: Use blk_new_open() in blk_connect()

2015-02-05 Thread Max Reitz
As part of the required changes, this fixes a bug where specifying an invalid driver would result in the block layer probing the image format; now it will result in an error, unless "" is specified as the driver name. Fixing this would require further work on the xen_disk code which does not seem w

[Qemu-devel] [PATCH v4 04/16] iotests: Add test for driver=qcow2, format=qcow2

2015-02-05 Thread Max Reitz
While specifying a different driver and format is obviously invalid, specifying the same driver once through driver and once through format is invalid as well. Add a test for it. Signed-off-by: Max Reitz --- tests/qemu-iotests/051 | 1 + tests/qemu-iotests/051.out | 3 +++ 2 files changed, 4

[Qemu-devel] [PATCH v4 13/16] qemu-io: Use BlockBackend

2015-02-05 Thread Max Reitz
qemu-io should behave like a guest, therefore it should use BlockBackend to access the block layer. There are a couple of places where that is infeasible: First, the bdrv_debug_* functions could theoretically be mirrored in the BlockBackend, but since these are functions internal to the block laye

[Qemu-devel] [PATCH v4 05/16] blockdev: Use blk_new_open() in blockdev_init()

2015-02-05 Thread Max Reitz
Due to different error propagation, this breaks tests 051 and 087; fix their output. Signed-off-by: Max Reitz --- blockdev.c | 92 +- tests/qemu-iotests/051.out | 62 +++ tests/qemu-iotests/087.out | 8 ++--

[Qemu-devel] [PATCH v4 03/16] block: Add Error parameter to bdrv_find_protocol()

2015-02-05 Thread Max Reitz
The argument given to bdrv_find_protocol() is just a file name, which makes it difficult for the caller to reconstruct what protocol bdrv_find_protocol() was hoping to find. This patch adds an Error parameter to that function to solve this issue. Suggested-by: Eric Blake Signed-off-by: Max Reitz

[Qemu-devel] [PATCH v4 00/16] block: Remove "growable", add blk_new_open()

2015-02-05 Thread Max Reitz
This series removes the "growable" field from the BlockDriverState object. Its use was to clamp guest requests against the limits of the BDS; however, this can now be done more easily by moving those checks into the BlockBackend functions. In a future series, "growable" may be reintroduced (maybe

Re: [Qemu-devel] [PATCH 1/1] target-i386: Clean up misuse of qdev_init() in realize method

2015-02-05 Thread Andreas Färber
Am 05.02.2015 um 13:51 schrieb Igor Mammedov: > On Thu, 5 Feb 2015 10:29:15 +0100 > Markus Armbruster wrote: > >> x86_cpu_apic_realize() calls qdev_init() to realize the APIC. >> qdev_init()'s error handling has unwanted side effects: it unparents >> the device, and it calls qerror_report_err().

Re: [Qemu-devel] [PATCH v2 38/47] acpi: add acpi_word_bus_number(), acpi_word_io(), acpi_dword_memory(), acpi_qword_memory() terms

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:38:17 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 143 > > + > > include/hw/acpi/acpi-build-utils.h | 73

Re: [Qemu-devel] [PATCH v2 38/47] acpi: add acpi_word_bus_number(), acpi_word_io(), acpi_dword_memory(), acpi_qword_memory() terms

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:38:17 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 143 > > + > > include/hw/acpi/acpi-build-utils.h | 73

Re: [Qemu-devel] [PATCH v2 35/47] acpi: add acpi_reserved_field() term

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:36:16 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 10 ++ > > include/hw/acpi/acpi-build-utils.h | 6 ++ > > 2 files changed, 16 insertions(+)

Re: [Qemu-devel] [PATCH v2 24/47] acpi: add acpi_operation_region() term

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:28:39 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 14 ++ > > include/hw/acpi/acpi-build-utils.h | 7 +++ > > 2 files changed, 21 insertio

Re: [Qemu-devel] [PATCH RFC v4 2/6] qemu-iotests: qemu machine type support

2015-02-05 Thread Eric Blake
On 02/05/2015 07:18 AM, Max Reitz wrote: >> reference_machine="$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out" >> +if [ -f $reference_machine ]; then > > Maybe this should be [ -f "$reference_machine" ]. I guess spaces in the > directory name will break the qemu-iotests anyway, but the

Re: [Qemu-devel] [PATCH v2 22/47] acpi: add acpi_io() helper

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:19:39 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:50 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 19 +++ > > include/hw/acpi/acpi-build-utils.h | 7 +++ > > 2 files changed, 26 ins

Re: [Qemu-devel] [PATCH v2 05/47] acpi: add acpi_if() term

2015-02-05 Thread Igor Mammedov
On Thu, 05 Feb 2015 17:01:33 +0200 Marcel Apfelbaum wrote: > On 01/22/2015 04:49 PM, Igor Mammedov wrote: > > Signed-off-by: Igor Mammedov > > --- > > hw/acpi/acpi-build-utils.c | 8 > > include/hw/acpi/acpi-build-utils.h | 1 + > > 2 files changed, 9 insertions(+) > > > > d

Re: [Qemu-devel] [PATCH v2] qcow2: Rewrite qcow2_alloc_bytes()

2015-02-05 Thread Eric Blake
On 02/05/2015 08:58 AM, Max Reitz wrote: > qcow2_alloc_bytes() is a function with insufficient error handling and > an unnecessary goto. This patch rewrites it. > > Signed-off-by: Max Reitz > --- > v2: > - s/free_cluster_index/free_byte_index/ [Eric] > - added an assertion at the start of the fun

[Qemu-devel] [PATCH v3 19/19] qtest/ahci: Adding simple dma read-write test

2015-02-05 Thread John Snow
Adds a test case for AHCI wherein we write a 4K block of a changing pattern to sector 0, then read back that 4K and compare the transmit and receive buffers. Reviewed-by: Stefan Hajnoczi Signed-off-by: John Snow --- tests/ahci-test.c | 55 +++

[Qemu-devel] [PATCH v3 10/19] qtest/ahci: add ahci_write_fis

2015-02-05 Thread John Snow
Similar to ahci_set_command_header, add a helper that takes an in-memory representation of a command FIS and writes it to guest memory, handling endianness as-needed. Signed-off-by: John Snow --- tests/ahci-test.c | 2 +- tests/libqos/ahci.c | 14 ++ tests/libqos/ahci.h | 3 ++-

[Qemu-devel] [PATCH v3 12/19] libqos/ahci: add ahci command functions

2015-02-05 Thread John Snow
This patch adds the AHCICommand structure, and a set of functions to operate on the structure. ahci_command_create - Initialize and create a new AHCICommand in memory ahci_command_free - Destroy this object. ahci_command_set_buffer - Set where the guest memory DMA buffer is. ahci_command_commit -

[Qemu-devel] [PATCH v3 15/19] libqos/ahci: Add ahci_guest_io

2015-02-05 Thread John Snow
ahci_guest_io is a shorthand function that will, in one shot, execute a data command on the guest to the specified guest buffer location, in the requested amount. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/libqos/ahci.c | 15 +++ tests/libqos/ahci.h | 2 ++ 2 fil

Re: [Qemu-devel] [PATCH v2 0/8] target-arm/linux-user-arm: implement setend, CPSR.E, SCTLR.EE

2015-02-05 Thread Peter Maydell
On 5 February 2015 at 17:33, Paolo Bonzini wrote: > Peter, I'm rebasing this and I'm unsure how SCTLR.EE should behave wrt > EL2. When setting CPSR_E from SCTLR.EE, should I use > A32_BANKED_CURRENT_REG_GET or env->sctlr[MAX(arm_current_el(env), 1])? This is for exception entry, yes? In the 32-b

[Qemu-devel] [PATCH v3 18/19] qtest/ahci: Assert sector size in identify test

2015-02-05 Thread John Snow
A minor sanity check to assert that the sector size is 512. The current block layer code deeply assumes that the IDE sector size will be 512 bytes, so we carry forward that assumption here. This is useful for the DMA tests, which currently assume that a sector will always be 512 bytes. Signed-off

[Qemu-devel] [PATCH v3 09/19] qtest/ahci: Demagic ahci tests.

2015-02-05 Thread John Snow
Add human-readable command names and other miscellaneous #defines to help make the code more readable. Some of these definitions are not yet used in this current series, but for convenience and sanity they have been lumped together here, as it's more trouble than it is worth in a test suite to han

[Qemu-devel] [PATCH v3 17/19] libqos/ahci: Add ahci_clean_mem

2015-02-05 Thread John Snow
Clean up guest memory being used in ahci_clean_mem, to be called during ahci_shutdown. With all guest memory leaks removed, add an option to the allocator to throw an assertion if a leak occurs. This test adds some sanity to both the AHCI library and the allocator. Signed-off-by: John Snow Revie

[Qemu-devel] [PATCH v3 11/19] libqos/ahci: Add ide cmd properties

2015-02-05 Thread John Snow
Add a structure that defines some properties of various IDE commands. These will be used to simplify the interface to the libqos AHCI calls, lessening the redundancy of specifying and respecifying properties of commands to various helper functions. Reviewed-by: Stefan Hajnoczi Signed-off-by: John

[Qemu-devel] [PATCH v3 16/19] libqos/ahci: add ahci_io

2015-02-05 Thread John Snow
ahci_io is a wrapper around ahci_guest_io that takes a pointer to host memory instead, and will create a guest memory buffer and copy the data to/from as needed and as appropriate for a read/write command, such that after a read, the guest data will be in a host buffer, and for a write, the data wi

[Qemu-devel] [PATCH v3 13/19] libqos/ahci: add ahci command verify

2015-02-05 Thread John Snow
Helps to verify that a command completed successfully. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/ahci-test.c | 16 ++-- tests/libqos/ahci.c | 15 +++ tests/libqos/ahci.h | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/

[Qemu-devel] [PATCH v3 14/19] libqos/ahci: add ahci command size setters

2015-02-05 Thread John Snow
Adds setters for size, prd_size and both via set_sizes. Reviewed-by: Stefan Hajnoczi Signed-off-by: John Snow --- tests/libqos/ahci.c | 22 ++ tests/libqos/ahci.h | 4 2 files changed, 26 insertions(+) diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index ce1f0

[Qemu-devel] [PATCH v3 08/19] libqos/ahci: Add cmd response sanity check helpers

2015-02-05 Thread John Snow
This patch adds a few helpers to help sanity-check the response of the AHCI device after a command. ahci_d2h_check_sanity inspects the D2H Register FIS, ahci_pio_check_sanity inspects the PIO Setup FIS, and ahci_cmd_check_sanity inspects the command header. To support the PIO sanity check, a new

[Qemu-devel] [PATCH v3 07/19] libqos/ahci: Add port_check_nonbusy helper

2015-02-05 Thread John Snow
A simple helper that asserts a given port is not busy processing any commands via the TFD, Command Issue and SACT registers. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/ahci-test.c | 1 + tests/libqos/ahci.c | 18 ++ tests/libqos/ahci.h | 1 + 3 files chang

[Qemu-devel] [PATCH v3 05/19] libqos/ahci: Add ahci_port_check_error helper

2015-02-05 Thread John Snow
ahci_port_check_error checks a given port's error registers and asserts that everything from the port-level view is still OK. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/ahci-test.c | 8 +--- tests/libqos/ahci.c | 22 ++ tests/libqos/ahci.h | 1 + 3

[Qemu-devel] [PATCH v3 02/19] libqos/ahci: Add ahci_port_clear helper

2015-02-05 Thread John Snow
Add a helper that assists in clearing out potentially old error and FIS information from an AHCI port's data structures. This ensures we always start with a blank slate for interrupt and FIS receipt information. Signed-off-by: John Snow Reviewed-by: Paolo Bonzini --- tests/ahci-test.c | 9 ++

  1   2   3   >