From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v6 08/10] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page Date: Tue, 17 Dec 2013 17:02:53 +0000 Message-ID: <1387299773.1025.21.camel@dagon.hellion.org.uk> References: <1387297678-17762-1-git-send-email-julien.grall@linaro.org> <1387297678-17762-9-git-send-email-julien.grall@linaro.org> <1387298217.1025.5.camel@dagon.hellion.org.uk> <52B082B0.8030903@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vsy2r-00032d-PA for xen-devel@lists.xenproject.org; Tue, 17 Dec 2013 17:02:57 +0000 In-Reply-To: <52B082B0.8030903@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: xen-devel@lists.xenproject.org, ian.jackson@eu.citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On Tue, 2013-12-17 at 16:58 +0000, Julien Grall wrote: > > If this function finds any non-present first or second level PTE then it > > will stop and exit (goto out), meaning it will miss any mappings which > > are higher up after the hole. > > > > e.g. if you have a guest p2m with RAM at 0-2M and 4-6M then > > relinquishing 0-6M will only actually free 0-2M, then abort on 4-6M. > > > > Perhaps this could be fixed by making relinquish_p2m_mapping loop over > > the address space relinquishing 2M chunks as it goes? This would > remove > > the need for the if ( op == RELINQUISH && .. && prempt() ) stuff, > > because you could add the preempt in that loop. > > I think you are wrong: > - every first pte exists. We return NULL in case of the address is very > high. > - if the second pte doesn't exist, we will create it (if it > fails we go out). Oops, I misread the code, sorry. I think you are correct. > For the last item, I think it's a bit stupid to create table if we are > removing/relinquish mapping. But I think it's an improvement for later. > There are lots of improvement to do in this function (eg: flushing). Agreed. Ian.