From: QingFeng Hao <haoqf@linux.vnet.ibm.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org,
Fam Zheng <famz@redhat.com>,
stefanha@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled
Date: Mon, 3 Jul 2017 14:01:45 +0800 [thread overview]
Message-ID: <799c3d2f-237c-9833-e8fe-0af6d461e252@linux.vnet.ibm.com> (raw)
In-Reply-To: <20170628102213.GB5378@noname.redhat.com>
在 2017/6/28 18:22, Kevin Wolf 写道:
> Am 28.06.2017 um 12:11 hat QingFeng Hao geschrieben:
>> 在 2017/6/24 0:21, Kevin Wolf 写道:
>>> From: Stefan Hajnoczi <stefanha@redhat.com>
>>>
>>> Old kvm.ko versions only supported a tiny number of ioeventfds so
>>> virtio-pci avoids ioeventfds when kvm_has_many_ioeventfds() returns 0.
>>>
>>> Do not check kvm_has_many_ioeventfds() when KVM is disabled since it
>>> always returns 0. Since commit 8c56c1a592b5092d91da8d8943c17777d6462a6f
>>> ("memory: emulate ioeventfd") it has been possible to use ioeventfds in
>>> qtest or TCG mode.
>>>
>>> This patch makes -device virtio-blk-pci,iothread=iothread0 work even
>>> when KVM is disabled.
>>>
>>> I have tested that virtio-blk-pci works under TCG both with and without
>>> iothread.
>>>
>>> Cc: Michael S. Tsirkin <mst@redhat.com>
>>> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>> ---
>>> hw/virtio/virtio-pci.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
>>> index 20d6a08..301920e 100644
>>> --- a/hw/virtio/virtio-pci.c
>>> +++ b/hw/virtio/virtio-pci.c
>>> @@ -1740,7 +1740,7 @@ static void virtio_pci_realize(PCIDevice *pci_dev, Error **errp)
>>> bool pcie_port = pci_bus_is_express(pci_dev->bus) &&
>>> !pci_bus_is_root(pci_dev->bus);
>>>
>>> - if (!kvm_has_many_ioeventfds()) {
>>> + if (kvm_enabled() && !kvm_has_many_ioeventfds()) {
>>> proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
>>> }
>> This response is actually for mail thread "Re: [Qemu-devel] [PATCH
>> 1/5] virtio-pci: use ioeventfd even when KVM is disabled"
>> which I didn't receive, sorry.
>> I also saw the failed case of 068 as Fam due to the same cause on
>> s390x and x86.
>> With this patch applied, no failure found. Further investigation
>> shows that the error is in
>> virtio_scsi_dataplane_setup:
>> if (!virtio_device_ioeventfd_enabled(vdev)) {
>> error_setg(errp, "ioeventfd is required for iothread");
>> return;
>> }
>> call flow is:
>> virtio_device_ioeventfd_enabled-->virtio_bus_ioeventfd_enabled
>> -->k->ioeventfd_enabled-->virtio_pci_ioeventfd_enabled
>> virtio_pci_ioeventfd_enabled checks flag
>> VIRTIO_PCI_FLAG_USE_IOEVENTFD which was
>> cleared in virtio_pci_realize if this patch isn't applied.
> Yes, we know all of this. However, this patch is not correct and causes
> 'make check' failures on some platforms. The open question is where that
> failure comes from. Before this is solved, the patch can't be applied.
Sorry that I found case 068 of the latest master still fails on s390x
(but passed
on x86) and the cause is that s390x uses "-device virtio-scsi-ccw"
instead of
"-device virtio-scsi-pci", so the change in virtio_ccw_device_realize is
also needed:
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 90d37cb..35896eb 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -711,7 +711,7 @@ static void
virtio_ccw_device_realize(VirtioCcwDevice *dev, Error
sch->cssid, sch->ssid, sch->schid, sch->devno,
ccw_dev->devno.valid ? "user-configured" : "auto-configured");
- if (!kvm_eventfds_enabled()) {
+ if (kvm_enabled() && !kvm_eventfds_enabled()) {
dev->flags &= ~VIRTIO_CCW_FLAG_USE_IOEVENTFD;
}
I'll send out a patch for that. Thanks!
> Kevin
>
--
Regards
QingFeng Hao
next prev parent reply other threads:[~2017-07-03 6:02 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 16:20 [Qemu-devel] [PULL 00/61] Block layer patches Kevin Wolf
2017-06-23 16:20 ` [Qemu-devel] [PULL 01/61] commit: Fix completion with extra reference Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 02/61] qemu-iotests: Allow starting new qemu after cleanup Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 03/61] qemu-iotests: Test exiting qemu with running job Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 04/61] block: count bdrv_co_rw_vmstate() requests Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 05/61] block: use BDRV_POLL_WHILE() in bdrv_rw_vmstate() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 06/61] migration: avoid recursive AioContext locking in save_vmstate() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 07/61] migration: use bdrv_drain_all_begin/end() instead bdrv_drain_all() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 08/61] doc: Document generic -blockdev options Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 09/61] doc: Document driver-specific " Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 10/61] throttle: Update throttle-groups.c documentation Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 11/61] virtio-pci: use ioeventfd even when KVM is disabled Kevin Wolf
2017-06-28 10:11 ` [Qemu-devel] [Qemu-block] " QingFeng Hao
2017-06-28 10:22 ` Kevin Wolf
2017-06-28 13:07 ` QingFeng Hao
2017-07-03 6:01 ` QingFeng Hao [this message]
2017-06-23 16:21 ` [Qemu-devel] [PULL 12/61] migration: hold AioContext lock for loadvm qemu_fclose() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 13/61] qemu-iotests: 068: extract _qemu() function Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 14/61] qemu-iotests: 068: use -drive/-device instead of -hda Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 15/61] qemu-iotests: 068: test iothread mode Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 16/61] nvme: Add support for Read Data and Write Data in CMBs Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 17/61] qcow2: Remove unused Error variable in do_perform_cow() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 18/61] qcow2: Use unsigned int for both members of Qcow2COWRegion Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 19/61] qcow2: Make perform_cow() call do_perform_cow() twice Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 20/61] qcow2: Split do_perform_cow() into _read(), _encrypt() and _write() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 21/61] qcow2: Allow reading both COW regions with only one request Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 22/61] qcow2: Pass a QEMUIOVector to do_perform_cow_{read, write}() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 23/61] qcow2: Merge the writing of the COW regions with the guest data Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 24/61] qcow2: Use offset_into_cluster() and offset_to_l2_index() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 25/61] qed: Use bottom half to resume waiting requests Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 26/61] qed: Make qed_read_table() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 27/61] qed: Remove callback from qed_read_table() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 28/61] qed: Remove callback from qed_read_l2_table() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 29/61] qed: Remove callback from qed_find_cluster() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 30/61] qed: Make qed_read_backing_file() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 31/61] qed: Make qed_copy_from_backing_file() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 32/61] qed: Remove callback from qed_copy_from_backing_file() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 33/61] qed: Make qed_write_header() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 34/61] qed: Remove callback from qed_write_header() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 35/61] qed: Make qed_write_table() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 36/61] qed: Remove GenericCB Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 37/61] qed: Remove callback from qed_write_table() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 38/61] qed: Make qed_aio_read_data() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 39/61] qed: Make qed_aio_write_main() synchronous Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 40/61] qed: Inline qed_commit_l2_update() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 41/61] qed: Add return value to qed_aio_write_l1_update() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 42/61] qed: Add return value to qed_aio_write_l2_update() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 43/61] qed: Add return value to qed_aio_write_main() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 44/61] qed: Add return value to qed_aio_write_cow() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 45/61] qed: Add return value to qed_aio_write_inplace/alloc() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 46/61] qed: Add return value to qed_aio_read/write_data() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 47/61] qed: Remove ret argument from qed_aio_next_io() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 48/61] qed: Remove recursion in qed_aio_next_io() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 49/61] qed: Implement .bdrv_co_readv/writev Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 50/61] qed: Use CoQueue for serialising allocations Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 51/61] qed: Simplify request handling Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 52/61] qed: Use a coroutine for need_check_timer Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 53/61] qed: Add coroutine_fn to I/O path functions Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 54/61] qed: Use bdrv_co_* for coroutine_fns Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 55/61] block: Remove bdrv_aio_readv/writev/flush() Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 56/61] block: change variable names in BlockDriverState Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 57/61] fix: avoid an infinite loop or a dangling pointer problem in img_commit Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 58/61] blkdebug: Catch bs->exact_filename overflow Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 59/61] blkverify: " Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 60/61] block: Do not strcmp() with NULL uri->scheme Kevin Wolf
2017-06-23 16:21 ` [Qemu-devel] [PULL 61/61] qemu-img: don't shadow opts variable in img_dd() Kevin Wolf
2017-06-26 10:23 ` [Qemu-devel] [PULL 00/61] Block layer patches Peter Maydell
2017-06-26 10:26 ` Peter Maydell
2017-06-26 12:50 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=799c3d2f-237c-9833-e8fe-0af6d461e252@linux.vnet.ibm.com \
--to=haoqf@linux.vnet.ibm.com \
--cc=famz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).