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

Re: [Xen-devel] [PATCH 3/3] x86/xen: use the maximum MFN to calculate the required DMA mask



>>> On 12.11.14 at 17:59, <david.vrabel@xxxxxxxxxx> wrote:
> On 12/11/14 15:55, Jan Beulich wrote:
>>>>> On 12.11.14 at 16:25, <david.vrabel@xxxxxxxxxx> wrote:
>>> +u64
>>> +xen_swiotlb_get_required_mask(struct device *dev)
>>> +{
>>> +   u64 max_mfn;
>>> +
>>> +   max_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
>>> +
>>> +   return DMA_BIT_MASK(fls64(max_mfn << PAGE_SHIFT) + 1);
>>> +}
>> 
>> The value the hypercall returns is exclusive and an unsigned long.
> 
> The docs in include/public/memory.h say:
> 
> "Returns the maximum machine frame number of mapped RAM in this system."
> 
> Which sounds inclusive to me...  Do we need a doc update here?

Possibly - the origin of this is Linux'es mis-named "max_page" I believe.
And in any event I'd expect you to base your code changes on reality,
not just on documentation...

Jan


_______________________________________________
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®.