From: Hollis Blanchard <hollisb@us.ibm.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [patch] fold struct vcpu_info into CPUState
Date: Fri, 24 Oct 2008 19:10:57 +0000 [thread overview]
Message-ID: <1224875457.9634.63.camel@localhost.localdomain> (raw)
In-Reply-To: <48E0F318.7050303@sgi.com>
On Fri, 2008-10-24 at 17:57 +0200, Jes Sorensen wrote:
> Hi,
>
> Here's an updated version of the patch, which builds against Avi's
> current tree. Please note this is a bit of a work in progress version
> as I am trying to eliminate the need for the vcpu -> env linear
> conversion, but I wanted to send out something before heading off for
> the weekend.
>
> Hollis if you have time to check this out for PPC, I would much
> appreciate it.
Unfortunately qemu segfaults halfway through guest kernel boot:
...
virtio-pci 0000:00:01.0: enabling device (0000 -> 0001)
vda:Segmentation fault
This is 100% repeatable, and it doesn't happen without your patch
applied.
0x10116f1c in kvm_update_interrupt_request (env=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:142
142 if (current_env->vcpu_info.created &&
(gdb) bt
#0 0x10116f1c in kvm_update_interrupt_request (env=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:142
#1 0x100b4a74 in cpu_interrupt (env=0x103d4718, mask=0x2)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/exec.c:1507
#2 0x10033d04 in ppc_set_irq (env=0x0, n_IRQ=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc.c:41
#3 0x10033e4c in ppc40x_set_irq (opaque=0x103d4718, pin=0x4, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc.c:400
#4 0x44004084 in ?? ()
#5 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#6 0x1006e408 in ppcuic_trigger_irq (uic=0x103f2c80)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.h:19
#7 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#8 0x1006edf4 in bamboo_pci_set_irq (pic=0x103d4718, irq_num=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc4xx_devs.c:837
#9 0x100170d4 in pci_set_irq (opaque=0x103d4718, irq_num=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/pci.c:560
#10 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#11 0x1003194c in virtio_update_irq (vdev=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/virtio.c:205
#12 0x10032ef4 in virtio_blk_rw_complete (opaque=0x10438008, ret=0x0)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/virtio-blk.c:119
#13 0x100ad680 in qcow_aio_read_cb (opaque=0x10432e58, ret=0x0)
at block-qcow2.c:1205
#14 0x1001c450 in posix_aio_read (opaque=0x103d4718) at block-raw-posix.c:550
#15 0x1000e5d8 in main_loop_wait (timeout=0xbfe5a978)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/vl.c:8352
#16 0x24000082 in ?? ()
#17 0x10117a00 in kvm_main_loop ()
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:614
#18 0x10011aa0 in main (argc=0x101b0000, argv=0x10380958)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/vl.c:8416
(gdb) p current_env
$1 = (struct CPUPPCState *) 0x0
(gdb)
It looks like qemu is actually switching threads when this happens...
I'm not sure what the current state is of qemu/KVM threads... I think we
have 1 thread per vcpu, plus 1 IO thread? If that's right, maybe
current_env isn't being initialized in the IO thread; I only see that
happening inside ap_main_loop(), which is the vcpu thread.
--
Hollis Blanchard
IBM Linux Technology Center
WARNING: multiple messages have this Message-ID (diff)
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Jes Sorensen <jes@sgi.com>
Cc: Glauber Costa <glommer@gmail.com>,
kvm@vger.kernel.org, kvm-ia64@vger.kernel.org
Subject: Re: [patch] fold struct vcpu_info into CPUState
Date: Fri, 24 Oct 2008 14:10:57 -0500 [thread overview]
Message-ID: <1224875457.9634.63.camel@localhost.localdomain> (raw)
In-Reply-To: <4901F083.3070006@sgi.com>
On Fri, 2008-10-24 at 17:57 +0200, Jes Sorensen wrote:
> Hi,
>
> Here's an updated version of the patch, which builds against Avi's
> current tree. Please note this is a bit of a work in progress version
> as I am trying to eliminate the need for the vcpu -> env linear
> conversion, but I wanted to send out something before heading off for
> the weekend.
>
> Hollis if you have time to check this out for PPC, I would much
> appreciate it.
Unfortunately qemu segfaults halfway through guest kernel boot:
...
virtio-pci 0000:00:01.0: enabling device (0000 -> 0001)
vda:Segmentation fault
This is 100% repeatable, and it doesn't happen without your patch
applied.
0x10116f1c in kvm_update_interrupt_request (env=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:142
142 if (current_env->vcpu_info.created &&
(gdb) bt
#0 0x10116f1c in kvm_update_interrupt_request (env=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:142
#1 0x100b4a74 in cpu_interrupt (env=0x103d4718, mask=0x2)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/exec.c:1507
#2 0x10033d04 in ppc_set_irq (env=0x0, n_IRQ=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc.c:41
#3 0x10033e4c in ppc40x_set_irq (opaque=0x103d4718, pin=0x4, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc.c:400
#4 0x44004084 in ?? ()
#5 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#6 0x1006e408 in ppcuic_trigger_irq (uic=0x103f2c80)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.h:19
#7 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#8 0x1006edf4 in bamboo_pci_set_irq (pic=0x103d4718, irq_num=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/ppc4xx_devs.c:837
#9 0x100170d4 in pci_set_irq (opaque=0x103d4718, irq_num=0x2, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/pci.c:560
#10 0x1007cc40 in qemu_set_irq (irq=0x103d4718, level=0x1)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/irq.c:38
#11 0x1003194c in virtio_update_irq (vdev=0x103d4718)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/virtio.c:205
#12 0x10032ef4 in virtio_blk_rw_complete (opaque=0x10438008, ret=0x0)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/hw/virtio-blk.c:119
#13 0x100ad680 in qcow_aio_read_cb (opaque=0x10432e58, ret=0x0)
at block-qcow2.c:1205
#14 0x1001c450 in posix_aio_read (opaque=0x103d4718) at block-raw-posix.c:550
#15 0x1000e5d8 in main_loop_wait (timeout=0xbfe5a978)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/vl.c:8352
#16 0x24000082 in ?? ()
#17 0x10117a00 in kvm_main_loop ()
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/qemu-kvm.c:614
#18 0x10011aa0 in main (argc=0x101b0000, argv=0x10380958)
at /home/hollisb/source/kvm-userspace-ppc.hg/qemu/vl.c:8416
(gdb) p current_env
$1 = (struct CPUPPCState *) 0x0
(gdb)
It looks like qemu is actually switching threads when this happens...
I'm not sure what the current state is of qemu/KVM threads... I think we
have 1 thread per vcpu, plus 1 IO thread? If that's right, maybe
current_env isn't being initialized in the IO thread; I only see that
happening inside ap_main_loop(), which is the vcpu thread.
--
Hollis Blanchard
IBM Linux Technology Center
next prev parent reply other threads:[~2008-10-24 19:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-29 15:24 [patch] fold struct vcpu_info into CPUState Jes Sorensen
2008-09-29 15:24 ` Jes Sorensen
2008-10-05 10:02 ` Avi Kivity
2008-10-05 10:02 ` Avi Kivity
2008-10-05 20:48 ` Glauber Costa
2008-10-05 20:48 ` Glauber Costa
2008-10-13 22:24 ` Glauber Costa
2008-10-13 22:24 ` Glauber Costa
2008-10-17 15:28 ` Jes Sorensen
2008-10-17 15:28 ` Jes Sorensen
2008-10-17 21:27 ` Glauber Costa
2008-10-17 21:27 ` Glauber Costa
2008-10-24 15:57 ` Jes Sorensen
2008-10-24 15:57 ` Jes Sorensen
2008-10-24 19:10 ` Hollis Blanchard [this message]
2008-10-24 19:10 ` Hollis Blanchard
2008-10-27 9:48 ` Jes Sorensen
2008-10-27 9:48 ` Jes Sorensen
2008-10-27 16:02 ` Hollis Blanchard
2008-10-27 16:02 ` Hollis Blanchard
2008-10-27 16:06 ` Jes Sorensen
2008-10-27 16:06 ` Jes Sorensen
-- strict thread matches above, loose matches on Subject: below --
2008-10-28 16:25 [patch] v4 - " Jes Sorensen
2008-10-28 16:25 ` Jes Sorensen
2008-10-29 13:01 ` Anthony Liguori
2008-10-29 13:01 ` Anthony Liguori
2008-10-29 13:04 ` Jes Sorensen
2008-10-29 13:04 ` Jes Sorensen
2008-10-29 13:09 ` Anthony Liguori
2008-10-29 13:09 ` Anthony Liguori
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=1224875457.9634.63.camel@localhost.localdomain \
--to=hollisb@us.ibm.com \
--cc=kvm-ia64@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.