From: "Michael S. Tsirkin" <mst@redhat.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>
Cc: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: virtio capabilities
Date: Wed, 18 Dec 2019 00:27:49 -0500 [thread overview]
Message-ID: <20191218002721-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <f3c32495-6fe4-7401-c96b-12e9b90e23d9@ozlabs.ru>
On Wed, Dec 18, 2019 at 04:19:57PM +1100, Alexey Kardashevskiy wrote:
>
>
> On 13/12/2019 19:36, Michael S. Tsirkin wrote:
> > On Fri, Dec 13, 2019 at 07:29:40PM +1100, Alexey Kardashevskiy wrote:
> >>
> >>
> >> On 13/12/2019 18:24, Michael S. Tsirkin wrote:
> >>> On Fri, Dec 13, 2019 at 05:05:05PM +1100, Alexey Kardashevskiy wrote:
> >>>> Hi!
> >>>>
> >>>> I am having an issue with capabilities (hopefully the chunk formatting
> >>>> won't break).
> >>>>
> >>>> The problem is that when virtio_pci_find_capability() reads
> >>>> pci_find_capability(dev, PCI_CAP_ID_VNDR), 0 is returned; if repeated,
> >>>> it returns a valid number (0x84). Timing seems to matter. pci_cfg_read
> >>>> trace shows that that first time read does not reach QEMU but others do
> >>>> reach QEMU and return what is expected.
> >>>>
> >>>> How to debug this, any quick ideas?
> >>>> The config space is not a MMIO BAR
> >>>> or KVM memory slot or anything like this, right? :) Thanks,
> >>>
> >>> Depends on the platform.
> >>>
> >>> E.g. on x86, when using cf8/cfc pair, if guest doesn't
> >>
> >>
> >> Is there an easy way to tell if it is this "cf8/cfc" case?
> >>
> >> I have these bars, is any of them related to cf8/cfc? Thanks,
> >>
> >> root@le-dbg:~# (qemu) info mtree -f
> >> FlatView #0
> >> AS "memory", root: system
> >> AS "cpu-memory-0", root: system
> >> Root memory region: system
> >> 0000000000000000-00000000ffffffff (prio 0, ram): ppc_spapr.ram kvm
> >> 0000200080000000-000020008000002f (prio 0, i/o): msix-table
> >> 0000200080000800-0000200080000807 (prio 0, i/o): msix-pba
> >> 0000210000000000-0000210000000fff (prio 0, i/o): virtio-pci-common
> >> 0000210000001000-0000210000001fff (prio 0, i/o): virtio-pci-isr
> >> 0000210000002000-0000210000002fff (prio 0, i/o): virtio-pci-device
> >> 0000210000003000-0000210000003fff (prio 0, i/o): virtio-pci-notify
> >>
> >
> >
> > No, you want stuff in hw/ppc/spapr_pci.c
>
>
> The problem was with our firmware, fixing that now.
>
> Out of curiosity. I do not see cf8/cfc on x86 either, or I just do not
> recognize those, what is this cf8/cfc?
E.g. i440fx:
static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
{
PCIHostState *s = PCI_HOST_BRIDGE(dev);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
sysbus_add_io(sbd, 0xcf8, &s->conf_mem);
sysbus_init_ioports(sbd, 0xcf8, 4);
sysbus_add_io(sbd, 0xcfc, &s->data_mem);
sysbus_init_ioports(sbd, 0xcfc, 4);
/* register i440fx 0xcf8 port as coalesced pio */
memory_region_set_flush_coalesced(&s->data_mem);
memory_region_add_coalescing(&s->conf_mem, 0, 4);
}
> Thanks,
>
> FlatView #2
>
> AS "memory", root: system
>
> AS "cpu-memory-0", root: system
>
> AS "piix3-ide", root: bus master container
>
> AS "virtio-net-pci", root: bus master container
>
> Root memory region: system
>
> 0000000000000000-00000000000bffff (prio 0, ram): pc.ram kvm
>
> 00000000000c0000-00000000000c0fff (prio 0, rom): pc.ram
> @00000000000c0000 kvm
> 00000000000c1000-00000000000c3fff (prio 0, ram): pc.ram
> @00000000000c1000 kvm
> 00000000000c4000-00000000000e7fff (prio 0, rom): pc.ram
> @00000000000c4000 kvm
> 00000000000e8000-00000000000effff (prio 0, ram): pc.ram
> @00000000000e8000 kvm
> 00000000000f0000-00000000000fffff (prio 0, rom): pc.ram
> @00000000000f0000 kvm
> 0000000000100000-000000007fffffff (prio 0, ram): pc.ram
> @0000000000100000 kvm
> 00000000febc0000-00000000febc002f (prio 0, i/o): msix-table
>
> 00000000febc0800-00000000febc0807 (prio 0, i/o): msix-pba
>
> 00000000febfc000-00000000febfcfff (prio 0, i/o): virtio-pci-common
>
> 00000000febfd000-00000000febfdfff (prio 0, i/o): virtio-pci-isr
>
> 00000000febfe000-00000000febfefff (prio 0, i/o): virtio-pci-device
>
> 00000000febff000-00000000febfffff (prio 0, i/o): virtio-pci-notify
>
> 00000000fec00000-00000000fec00fff (prio 0, i/o): kvm-ioapic
>
> 00000000fed00000-00000000fed003ff (prio 0, i/o): hpet
>
> 00000000fee00000-00000000feefffff (prio 4096, i/o): kvm-apic-msi
>
> 00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios kvm
>
>
>
> --
> Alexey
prev parent reply other threads:[~2019-12-18 5:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-13 6:05 virtio capabilities Alexey Kardashevskiy
2019-12-13 7:24 ` Michael S. Tsirkin
2019-12-13 8:29 ` Alexey Kardashevskiy
2019-12-13 8:36 ` Michael S. Tsirkin
2019-12-18 5:19 ` Alexey Kardashevskiy
2019-12-18 5:27 ` 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=20191218002721-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=aik@ozlabs.ru \
--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.