From: Tim Deegan Subject: Re: [PATCH RFC v2 1/4] x86/mm: Shadow and p2m changes for PV mem_access Date: Thu, 28 Aug 2014 22:37:26 +0200 Message-ID: <20140828203726.GA8094@deinos.phlegethon.org> References: <1404787805-4540-1-git-send-email-aravindp@cisco.com> <1404787805-4540-2-git-send-email-aravindp@cisco.com> <53D13457020000780002599B@mail.emea.novell.com> <97A500D504438F4ABC02EBA81613CC633188B795@xmb-aln-x02.cisco.com> <53D221270200007800025CEA@mail.emea.novell.com> <97A500D504438F4ABC02EBA81613CC633188BE3A@xmb-aln-x02.cisco.com> <20140828091442.GB60905@deinos.phlegethon.org> <97A500D504438F4ABC02EBA81613CC63318E4DD6@xmb-aln-x02.cisco.com> <20140828190030.GA2147@deinos.phlegethon.org> <97A500D504438F4ABC02EBA81613CC63318E4EE6@xmb-aln-x02.cisco.com> 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 1XN6Rw-00026n-66 for xen-devel@lists.xenproject.org; Thu, 28 Aug 2014 20:37:40 +0000 Content-Disposition: inline In-Reply-To: <97A500D504438F4ABC02EBA81613CC63318E4EE6@xmb-aln-x02.cisco.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Aravindh Puthiyaparambil (aravindp)" Cc: "xen-devel@lists.xenproject.org" , Keir Fraser , Ian Jackson , Jan Beulich , Ian Campbell List-Id: xen-devel@lists.xenproject.org At 19:23 +0000 on 28 Aug (1409250226), Aravindh Puthiyaparambil (aravindp) wrote: > In the PV case step 2 is problematic as the range of pages that > belong to the PV guest is unknown to the mem-access listener. I > tried adding another PV specific API for setting default access that > will walk the page_list and set the shadow_flag to default. But Jan > rightly pointed out issues surrounding hypercall preemption / > continuation during which, the page_list could be modified. So my > current plan is to blow all shadow pages every time the API for > setting default access is called. The on the subsequent page-faults > where the PTE is marked not present, set the shadow_flag to the > default access as part of creating the PTE. How do you know when this step finishes? I.e. how can you tell the difference between an access field in the shadow_flags that was set before you enabled mem_access and one that was set since? At some point you need some more state - either something resetting the shadow_flags (though indeed I don't know how to do that reliably and safely) or an epoch counter (which there isn't room for) or some other trick that I can't think of right now. I wonder if it's possible just to mandate in the API that you might get spurious mem_access faults in this case. A bit ugly though. :( Tim.