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

Re: [Xen-devel] [v4][PATCH 4/9] tools:libxc: check if mmio BAR is out of RMRR mappings



On Fri, 2014-08-22 at 18:09 +0800, Tiejun Chen wrote:

> +    /* We should check if mmio range is out of RMRR mapping.
> +     *
> +     * Assume we have one entry if not enough we'll expand.
> +     */

The usual approach with such hypervisor interfaces (which I suppose
xc_reserved_device_memory_map turns into) is to first call it with NULL
to get the required size and then allocate a suitable buffer and call a
second time.


> +    for ( i = 0; i < rc; i++ )
> +    {
> +        rmrr_start = map[i].pfn << PAGE_SHIFT;
> +        rmrr_end = rmrr_start + map[i].count * PAGE_SIZE;
> +        if ( check_mmio_hole(rmrr_start, map[i].count * PAGE_SIZE,

Adding rmrr_size = map... & PAGE_SIZE could be used twice here.

Ian.


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


 


Rackspace

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