Re: [kvm-unit-tests PATCH v2 1/4] pci: Rework pci_bar_is_valid()

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

 



On Sat, Jan 28, 2017 at 12:10:41PM +0100, Andrew Jones wrote:
> How about just this instead (untested)
> 
>  bool pci_bar_is_valid(pcidevaddr_t dev, int bar_num)
>  {
>    assert(bar_num >= 0 && bar_num < PCI_BAR_NUM);
>    if (bar_num > 0 && pci_bar_is64(dev, bar_num - 1))
>      return pci_bar_is_valid(dev, bar_num - 1);
>    return pci_bar_size(dev, bar_num);
>  }

This one can not distinguish between PCI_BASE_ADDRESS_* flags
and address bits of high part of a 64 bit address.

However, it seems a newly introduced pci_dev::resource[] can
be used for that.

> Thanks,
> drew



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux