qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: virtio capabilities


From: Michael S. Tsirkin
Subject: Re: virtio capabilities
Date: Wed, 18 Dec 2019 00:27:49 -0500

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]