Messages in this thread | | | Date | Thu, 20 Nov 2014 11:42:32 +0000 | From | David Vrabel <> | Subject | Re: [Xen-devel] [PATCH 4/4] x86/xen: use the maximum MFN to calculate the required DMA mask |
| |
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
| |