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

Re: [Xen-devel] [RFC PATCH 2/3] arch, arm32: add the XEN_DOMCTL_memory_mapping hypercall

Hello Eric,

On 04/03/14 02:06, Eric Trudeau wrote:
Last I checked, map_mmio_regions takes paddr_t, not frame numbers.


Beware:  I found that map_mmio_regions was off by one page unless I changed
"gfn + nr_mfns - 1" to "gfn + nr_mfns".
This may have been fixed in more recent upstream code.

That makes me think, map_mmio_regions is buggy if the range is not correctly aligned. For instance:

start_gaddr = 0x1001 and end_gaddr = 0x2001, we only map 0x1000-0x2000 to the domain.

The problem is the same with p2m_populate_ram (even if I doubt that RAM range is not page-aligned).

I see 2 solutions to fix it:
        - Change map_mmio_regions prototype to use frame is instead address.
        - Aligned the input addresses.

IHMO, the former seems to be better, at least it avoid developer to discover that some bits was mapped under his feet.

Ian, do you have any opinion?


Julien Grall

Xen-devel mailing list



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