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

Re: [Xen-devel] [PATCH] tools/hvmloader: Use base instead of pci_mem_start for find_next_rmrr()



>>> On 21.08.17 at 23:53, <xiong.y.zhang@xxxxxxxxx> wrote:
> @@ -464,15 +462,19 @@ void pci_setup(void)
>          base = (resource->base  + bar_sz - 1) & ~(uint64_t)(bar_sz - 1);
>  
>          /* If we're using mem_resource, check for RMRR conflicts. */
> -        while ( resource == &mem_resource &&
> -                next_rmrr >= 0 &&
> -                check_overlap(base, bar_sz,
> -                              memory_map.map[next_rmrr].addr,
> -                              memory_map.map[next_rmrr].size) )
> +        if ( resource == &mem_resource)
>          {
> -            base = memory_map.map[next_rmrr].addr + 
> memory_map.map[next_rmrr].size;
> -            base = (base + bar_sz - 1) & ~(bar_sz - 1);
>              next_rmrr = find_next_rmrr(base);
> +            while ( next_rmrr >= 0 &&
> +                    check_overlap(base, bar_sz,
> +                              memory_map.map[next_rmrr].addr,
> +                              memory_map.map[next_rmrr].size) )
> +            {
> +                base = memory_map.map[next_rmrr].addr +
> +                       memory_map.map[next_rmrr].size;
> +                base = (base + bar_sz - 1) & ~(bar_sz - 1);
> +                next_rmrr = find_next_rmrr(base);
> +            }
>          }

Looks good, but please reduce the scope of next_rmrr to just this
if() (afaict it's no longer used anywhere else).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.