From: "Michael S. Tsirkin" <mst@redhat.com>
To: Bernhard Kohl <bernhard.kohl@nsn.com>, mtosatti@redhat.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH comment tweaked] msix: allow byte and word reading from mmio
Date: Wed, 17 Nov 2010 16:28:16 +0200 [thread overview]
Message-ID: <20101117142816.GA15204@redhat.com> (raw)
In-Reply-To: <4CE2B49A.7000701@nsn.com>
On Tue, Nov 16, 2010 at 05:43:06PM +0100, Bernhard Kohl wrote:
> Am 16.11.2010 14:14, schrieb mst@redhat.com:
> >Although explicitly disallowed by the PCI spec, some guests read a
> >single byte or word from mmio. Likely a guest OS bug, but I have an OS
> >which reads single bytes and it works fine on real hardware.
> >
> >Signed-off-by: Bernhard Kohl<bernhard.kohl@nsn.com>
> >Signed-off-by: Michael S. Tsirkin<mst@redhat.com>
> >---
> >
> >OK so it could like something like the below.
>
> Yes, this looks good for me.
>
> > However, my question is:
> >do we need to put this in or can the guest simply be fixed?
>
> I tried to locate the code where the readw occurs,
> but not successful. It only occurs during booting our OS,
> and the virtio-net driver seems to be OK. With 4 virtio
> NICs we have the following readw accesses, thats all!
> 3 accesses per NIC and the first NIC appears twice.
>
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000008
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000018
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000028
> MSI-X: msix_mmio_readw dev=0x9772c40 addr=0000000000000008
> MSI-X: msix_mmio_readw dev=0x9772c40 addr=0000000000000018
> MSI-X: msix_mmio_readw dev=0x9772c40 addr=0000000000000028
> MSI-X: msix_mmio_readw dev=0x977dc38 addr=0000000000000008
> MSI-X: msix_mmio_readw dev=0x977dc38 addr=0000000000000018
> MSI-X: msix_mmio_readw dev=0x977dc38 addr=0000000000000028
> MSI-X: msix_mmio_readw dev=0x9788d90 addr=0000000000000008
> MSI-X: msix_mmio_readw dev=0x9788d90 addr=0000000000000018
> MSI-X: msix_mmio_readw dev=0x9788d90 addr=0000000000000028
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000008
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000018
> MSI-X: msix_mmio_readw dev=0x9767c58 addr=0000000000000028
>
> Is it possible to add a stack back tace printing to the
> readw function?
See some words of wisdom from Marcelo (this appliues to qemu-kvm.git):
<mst> marcelot, there is a guest that misbehaves
<mst> marcelot, so we get an fprintf in qemu
<mst> marcelot, but we don't know which place in guest caused the
problem, no backtrace, etc
<marcelot> mst, print guest RIP there?
<mst> marcelot, 1. how to?
<marcelot> mst, cpu_synchronize_state(cpu_single_env) + print (env->eip)
<marcelot> s/env/cpu_single_env/
<mst> marcelot, 2. can we also make it so that when io completes, guest
stops with backtrace in gdb?
<marcelot> mst, see kvm_show_code in qemu-kvm-x86.c
<marcelot> mst, either add a breakpoint there, or call abort() and gdb
core later
<mst> marcelot, abort will exit qemu though. gdb core will give me qemu
backtrace, not guest one, right?
<mst> marcelot, I would like kvm to pretend it hit a breakpoint
<mst> marcelot, or a segfault ... something
<marcelot> mst, well, vmstop() then. you can see guest RIP from there.
<marcelot> mst, yes gdb core will give qemu backtrace. inject a #GP to
see guest backtrace (see kvm_put_vcpu_events in qemu-kvm-x86.c
<marcelot> )
--
MST
prev parent reply other threads:[~2010-11-17 14:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-16 13:14 [Qemu-devel] [PATCH comment tweaked] msix: allow byte and word reading from mmio mst
2010-11-16 16:43 ` [Qemu-devel] " Bernhard Kohl
2010-11-17 14:12 ` Michael S. Tsirkin
2010-11-17 16:12 ` Bernhard Kohl
2010-11-17 16:30 ` Michael S. Tsirkin
2010-11-24 14:35 ` Bernhard Kohl
2010-11-17 14:28 ` Michael S. Tsirkin [this message]
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=20101117142816.GA15204@redhat.com \
--to=mst@redhat.com \
--cc=bernhard.kohl@nsn.com \
--cc=mtosatti@redhat.com \
--cc=qemu-devel@nongnu.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.