Re: [PATCH v10 06/17] Xen: ARM: Add support for mapping platform device mmio

From: Shannon Zhao
Date: Wed Apr 06 2016 - 21:37:55 EST




On 2016/4/6 20:16, Julien Grall wrote:
>> + gpfns[j] = XEN_PFN_DOWN(r->start) + j;
>> + idxs[j] = XEN_PFN_DOWN(r->start) + j;
>> + }
>> +
>> + xatp.domid = DOMID_SELF;
>> + xatp.size = nr;
>> + xatp.space = XENMAPSPACE_dev_mmio;
>> +
>> + set_xen_guest_handle(xatp.gpfns, gpfns);
>> + set_xen_guest_handle(xatp.idxs, idxs);
>> + set_xen_guest_handle(xatp.errs, errs);
>> +
>> + rc = HYPERVISOR_memory_op(XENMEM_add_to_physmap_range, &xatp);
>> + kfree(gpfns);
>> + kfree(idxs);
>> + kfree(errs);
>> + if (rc)
>> + return rc;
>
> Shouldn't we redo the mapping if the hypercall fails?
Hmm, why? If it fails again when we redo the mapping, what should we do
then? Redo again?
I think if it fails at the first time it will always fail no matter how
many times we do.

Thanks,
--
Shannon