From: Tim Deegan Subject: Re: [PATCH 1 of 2] x86/mm: When mem event automatically promotes access rights, let other subsystems know Date: Thu, 1 Dec 2011 16:53:03 +0000 Message-ID: <20111201165303.GK61203@ocelot.phlegethon.org> References: <20111201161718.GI61203@ocelot.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andres Lagar-Cavilla Cc: andres@gridcentric.ca, xen-devel@lists.xensource.com, keir.xen@gmail.com, jbeulich@suse.com, adin@gridcentric.ca List-Id: xen-devel@lists.xenproject.org At 08:39 -0800 on 01 Dec (1322728771), Andres Lagar-Cavilla wrote: > > I wonder whether, rather than trying to enumerate all the acceptable > > cases here, you could just remember that p2m_mem_access_check() changed > > something and always return 1 in that case. > > > That's the behavior without this patch, isn't it? Yes, but that's not the _interesting_ change in this patch. :) The interesting thing is that you can upgrade the access rights and also pass the fault to the mmio emulator without returning and retrying in between. That is, I thin the change from if (access fixup) return 1 handle MMIO ... return 0 /* unhandled -- crash */ to if (access fixup) remember we've done something handle MMIO ... if (we did a fixup above) return 1 /* try again */ else return 0 /* crash */ does what you want without making the handler much bigger and more brittle. Tim.