On 06/06/2016 09:51 AM, Jan Beulich wrote: >>>> On 06.06.16 at 15:03, <boris.ostrov...@oracle.com> wrote: >> On 06/06/2016 04:11 AM, Jan Beulich wrote: >>> @@ -225,38 +225,42 @@ static inline void read_dev_bar(struct p >>> (PCI_BASE_ADDRESS_SPACE_MEMORY | >>> PCI_BASE_ADDRESS_MEM_TYPE_64))) { >>> bar_info->val = res[pos - 1].start >> 32; >>> - bar_info->len_val = res[pos - 1].end >> 32; >>> + bar_info->len_val = -resource_size(&res[pos - 1]) >> 32; >>> return; >>> } >>> } >>> >>> + if (!res[pos].flags || >>> + (res[pos].flags & (IORESOURCE_DISABLED | IORESOURCE_UNSET | >>> + IORESOURCE_BUSY))) >>> + return; >> Why are you not making this check first thing in the routine? > For one, pos isn't set there yet. And I'd also rather avoid the > complications resulting from 64-bit memory resources spanning > two entries.
I thought that both words of a 64-bit BAR would result in a return under this check so both would be zero. But yes, pos needs to be initialized anyway (I didn't see this in the diff). Reviewed-by: Boris Ostrovsky <boris.ostrov...@oracle.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel