From: "Jan Beulich" Subject: Re: [PATCH v3 1/5] move XENMEM_add_to_physmap handling framework to common code Date: Fri, 20 Dec 2013 12:45:44 +0000 Message-ID: <52B44A08020000780010F8A9@nat28.tlf.novell.com> References: <52B1BF76020000780010EC02@nat28.tlf.novell.com> <52B40C69020000780010F5F6@nat28.tlf.novell.com> <52B42B6E020000780010F720@nat28.tlf.novell.com> <52B42CDE020000780010F739@nat28.tlf.novell.com> <52B43786.6040309@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VtzSb-0003M6-7X for xen-devel@lists.xenproject.org; Fri, 20 Dec 2013 12:45:45 +0000 In-Reply-To: <52B43786.6040309@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel , Tim Deegan , KeirFraser , Ian Campbell , StefanoStabellini List-Id: xen-devel@lists.xenproject.org >>> On 20.12.13 at 13:26, Andrew Cooper wrote: > On 20/12/13 10:41, Jan Beulich wrote: >> + case XENMEM_add_to_physmap: >> + if ( !rc || cmp.atp.space != XENMAPSPACE_gmfn_range ) >> + break; > > Why is this check here in the compat layer? Surely the -ENOSYS from > do_memory_op is sufficient to be included in the !rc check ? > >> + >> + XLAT_add_to_physmap(&cmp.atp, nat.atp); >> + if ( __copy_to_guest(compat, &cmp.atp, 1) ) >> + rc = -EFAULT; >> + >> + break; You mis-read the meaning of the check: The reverse translation was necessary (it's gone with patch 2 anyway) only when wanting to copy back into the interface structure. Since that code is gone with us no longer doing these invalid modifications, any possible incorrectness here is moot now anyway. Jan