From: Laszlo Ersek <lersek@redhat.com>
To: ronnie sahlberg <ronniesahlberg@gmail.com>
Cc: Bug 1191606 <1191606@bugs.launchpad.net>,
qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Bug 1191606] Re: qemu crashes with iscsi initiator (libiscsi) when using virtio
Date: Wed, 19 Jun 2013 11:17:24 +0200 [thread overview]
Message-ID: <51C17724.5040309@redhat.com> (raw)
In-Reply-To: <CAN05THSA98Nk3x_5rwi9iEFSGs+wS9FJiCHGN3dKfPM20rzbeg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]
On 06/19/13 06:34, ronnie sahlberg wrote:
> I can reproduce with current QEMU.
>
> Ubuntu 13 crashes with if=virtio but if=ide is fine.
>
>
> But it seems dependent on the guest/kernel.
>
> For example Fedora-18-x86_64-Live-Desktop.iso installs and runs just
> fine, even with virtio
> But both ubuntu-12.04-desktop-amd64.iso or
> ubuntu-13.04-desktop-amd64.iso crash with if=virtio
>
>
> Stack backtrace I got is
> #0 0x00007f7a9e22d037 in __GI_raise (sig=sig@entry=6)
> at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1 0x00007f7a9e230698 in __GI_abort () at abort.c:90
> #2 0x00007f7aa0a93ec8 in qemu_ram_addr_from_host_nofail (
> ptr=ptr@entry=0x2020202024008000) at /DATA/SRC/qemu-kvm/qemu/exec.c:1399
> #3 0x00007f7aa0a94a50 in address_space_unmap (as=<optimised out>,
> buffer=0x2020202024008000, len=<optimised out>, is_write=<optimised out>,
> access_len=1) at /DATA/SRC/qemu-kvm/qemu/exec.c:2155
> #4 0x00007f7aa0a94bef in cpu_physical_memory_unmap (buffer=<optimised out>,
> len=<optimised out>, is_write=<optimised out>, access_len=<optimised out>)
> at /DATA/SRC/qemu-kvm/qemu/exec.c:2189
> #5 0x00007f7aa0ad7867 in virtqueue_fill (vq=vq@entry=0x7f7aa34277f0,
> elem=elem@entry=0x7f7aa37ca328, len=1, idx=idx@entry=0)
> at /DATA/SRC/qemu-kvm/qemu/hw/virtio/virtio.c:243
> #6 0x00007f7aa0ad79cf in virtqueue_push (vq=0x7f7aa34277f0,
> elem=elem@entry=0x7f7aa37ca328, len=<optimised out>)
> at /DATA/SRC/qemu-kvm/qemu/hw/virtio/virtio.c:279
> #7 0x00007f7aa0aa9989 in virtio_blk_req_complete (
> req=req@entry=0x7f7aa37ca320, status=status@entry=0)
> at /DATA/SRC/qemu-kvm/qemu/hw/block/virtio-blk.c:49
> #8 0x00007f7aa0aa9ffb in virtio_blk_handle_request (
> req=req@entry=0x7f7aa37ca320, mrb=mrb@entry=0x7fff7a7b2060)
> at /DATA/SRC/qemu-kvm/qemu/hw/block/virtio-blk.c:376
Can you try the attached patch? It will produce quite a bit of output on
stderr.
Thanks
Laszlo
[-- Attachment #2: 0001-log-map-unmap-in-virtqueue_map_sg-and-virtqueue_fill.patch --]
[-- Type: text/plain, Size: 2516 bytes --]
>From 18b0c531e9ff1c33cce517c308c8330dd7d33a43 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek <lersek@redhat.com>
Date: Wed, 19 Jun 2013 10:37:31 +0200
Subject: [PATCH] log map/unmap in virtqueue_map_sg() and virtqueue_fill(), plus blk req type
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
hw/block/virtio-blk.c | 1 +
hw/virtio/virtio.c | 9 +++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index cf12469..14cf898 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -358,6 +358,7 @@ static void virtio_blk_handle_request(VirtIOBlockReq *req,
req->in = (void *)req->elem.in_sg[req->elem.in_num - 1].iov_base;
type = ldl_p(&req->out->type);
+ fprintf(stderr, "%s: type=0x%08" PRIx32 "\n", __FUNCTION__, type);
if (type & VIRTIO_BLK_T_FLUSH) {
virtio_blk_handle_flush(req, mrb);
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 8176c14..0af31c5 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -240,6 +240,9 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
for (i = 0; i < elem->in_num; i++) {
size_t size = MIN(len - offset, elem->in_sg[i].iov_len);
+ fprintf(stderr, "%s: unmapping hva=%p for length=%zu, "
+ "access_len=%zu, is_write=1\n", __FUNCTION__,
+ elem->in_sg[i].iov_base, elem->in_sg[i].iov_len, size);
cpu_physical_memory_unmap(elem->in_sg[i].iov_base,
elem->in_sg[i].iov_len,
1, size);
@@ -248,6 +251,9 @@ void virtqueue_fill(VirtQueue *vq, const VirtQueueElement *elem,
}
for (i = 0; i < elem->out_num; i++)
+ fprintf(stderr, "%s: unmapping hva=%p for length=access_len=%zu, "
+ "is_write=0\n", __FUNCTION__, elem->out_sg[i].iov_base,
+ elem->out_sg[i].iov_len);
cpu_physical_memory_unmap(elem->out_sg[i].iov_base,
elem->out_sg[i].iov_len,
0, elem->out_sg[i].iov_len);
@@ -430,6 +436,9 @@ void virtqueue_map_sg(struct iovec *sg, hwaddr *addr,
error_report("virtio: trying to map MMIO memory");
exit(1);
}
+ fprintf(stderr, "%s: mapped gpa=" TARGET_FMT_plx " at hva=%p "
+ "for length=%" HWADDR_PRIu ", is_write=%d\n", __FUNCTION__,
+ addr[i], sg[i].iov_base, len, is_write);
}
}
--
1.7.1
next prev parent reply other threads:[~2013-06-19 9:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-16 23:48 [Qemu-devel] [Bug 1191606] [NEW] qemu crashes with iscsi initiator (libiscsi) when using virtio Klaus Hochlehnert
2013-06-16 23:54 ` [Qemu-devel] [Bug 1191606] " Klaus Hochlehnert
2013-06-17 13:02 ` [Qemu-devel] [Bug 1191606] [NEW] " Stefan Hajnoczi
2013-06-17 17:37 ` [Qemu-devel] [Bug 1191606] " Klaus Hochlehnert
2013-06-18 9:38 ` Stefan Hajnoczi
2013-06-18 12:26 ` Laszlo Ersek
2013-06-18 14:37 ` Stefan Hajnoczi
2013-06-18 18:01 ` Klaus Hochlehnert
2013-06-18 19:36 ` Laszlo Ersek
2013-06-19 4:34 ` ronnie sahlberg
2013-06-19 8:54 ` Stefan Hajnoczi
2013-06-19 9:17 ` Laszlo Ersek [this message]
2013-06-20 13:33 ` ronnie sahlberg
2013-06-20 14:47 ` Laszlo Ersek
2013-06-20 15:31 ` ronnie sahlberg
2013-06-20 15:47 ` Laszlo Ersek
2013-06-24 19:46 ` Laszlo Ersek (Red Hat)
2013-09-25 6:25 ` Klaus Hochlehnert
2013-09-25 7:30 ` Paolo Bonzini
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=51C17724.5040309@redhat.com \
--to=lersek@redhat.com \
--cc=1191606@bugs.launchpad.net \
--cc=qemu-devel@nongnu.org \
--cc=ronniesahlberg@gmail.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).