Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754433AbcDGBhw (ORCPT ); Wed, 6 Apr 2016 21:37:52 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:38211 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753489AbcDGBhu (ORCPT ); Wed, 6 Apr 2016 21:37:50 -0400 Message-ID: <5705B9BD.1020403@huawei.com> Date: Thu, 7 Apr 2016 09:37:01 +0800 From: Shannon Zhao User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Julien Grall , Shannon Zhao , , CC: , , , , , , , Subject: Re: [PATCH v10 06/17] Xen: ARM: Add support for mapping platform device mmio References: <1459525755-36968-1-git-send-email-shannon.zhao@linaro.org> <1459525755-36968-7-git-send-email-shannon.zhao@linaro.org> <5704FE2C.5000902@arm.com> In-Reply-To: <5704FE2C.5000902@arm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.16.142] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5705B9DB.004A,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 351cc65ee18febfedb5131b1e2fc77e0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 904 Lines: 31 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