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

From: David Vrabel
Date: Thu Nov 20 2014 - 06:42:40 EST


On 19/11/14 17:51, Stefano Stabellini wrote:
> On Wed, 19 Nov 2014, David Vrabel wrote:
>>
>> +u64
>> +xen_swiotlb_get_required_mask(struct device *dev)
>> +{
>> + unsigned long max_mfn;
>> +
>> + max_mfn = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
>
> As Jan pointed out, I think you need to change the prototype of
> HYPERVISOR_memory_op to return long. Please do consistently across all
> relevant archs.

This doesn't help since 32-bit guests will still truncate. A new
hypercall op that returns the result in a uint64_t parameter is required.

There is another reason why max_mfn isn't suitable -- IOMMU usage so I
think we should assume a 64-bit DMA mask is required (this is actually
the change I put into XenServer's kernel).

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/