From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH V14 3/7] xen/arm: Allow hypervisor access to mem_access protected pages Date: Wed, 15 Apr 2015 14:48:40 +0100 Message-ID: <1429105720.15516.294.camel@citrix.com> References: <1427407531-31694-1-git-send-email-tklengyel@sec.in.tum.de> <1427407531-31694-4-git-send-email-tklengyel@sec.in.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1427407531-31694-4-git-send-email-tklengyel@sec.in.tum.de> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tamas K Lengyel Cc: wei.liu2@citrix.com, stefano.stabellini@eu.citrix.com, ian.jackson@eu.citrix.com, julien.grall@linaro.org, tim@xen.org, xen-devel@lists.xen.org, stefano.stabellini@citrix.com, jbeulich@suse.com, keir@xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2015-03-26 at 23:05 +0100, Tamas K Lengyel wrote: > @@ -1209,6 +1306,10 @@ struct page_info *get_page_from_gva(struct domain *d, vaddr_t va, > > err: > spin_unlock(&p2m->lock); > + > + if ( !page && p2m->mem_access_enabled ) > + page = p2m_mem_access_check_and_get_page(va, flags); Is this safe/correct to do without continuing to hold the p2m lock? It seems like the result of gva_to_ipa in the new function perhaps ought to be? Not sure about the p2m_get_mem_access (or does it have its own lock? Should it?) The case I'm thinking about is something else (grant ops etc) changing the p2m between the first check in get_page_from_gva and this one. Worst case would be spurious results from a race, which perhaps are tolerable? The rest of it looked good to me. Ian.