On Tue, 14 Dec 2010 12:37:32 -0600
Scott Wood <scottw...@freescale.com> wrote:

> On Tue, 14 Dec 2010 18:48:18 +0100
> Alexander Graf <ag...@suse.de> wrote:
> 
> > The critical section is to prevent us from overwriting the scratch
> > registers, yeah. And I think you're right - I had a thinko last night.
> > 
> > If we see that we should inject an interrupt, but we're inside of a
> > critical section, we could set the magic page to r/o and try to find the
> > critical end at which point we can just inject.
> 
> Yeah, I thought of that as well -- but single stepping seemed better
> than messing with MMU code (one less thing to check for on the TLB miss
> path), and it shouldn't happen often enough, or for enough instructions,
> to be a performance issue.

Well, the TLB path might not be so bad if it can reuse an existing
check for mapping the magic page in the first place -- but if an
interrupt happens immediately after setting critical, but before saving
scratch registers, the critical end will not be the next magic page
write.  So you'd still have to either single-step or emulate the stores
at least.

Or I suppose we could document that all magic page stores other than
ending critical must come before checking int_pending, though that seems
a bit ugly.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to