]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen: deal with stale cr3 values when unpinning pagetables
authorJeremy Fitzhardinge <jeremy@goop.org>
Fri, 12 Oct 2007 21:11:37 +0000 (14:11 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 16 Nov 2007 16:22:57 +0000 (08:22 -0800)
commitedf06ad73aa3054aec42e1c27faf3ab4b497a1d3
tree63e70bbf2432b85022a898c5ab99c0cf9caa52cf
parent4fc04833aaa0d7604e7fb7bbaa6854a4ff254b50
xen: deal with stale cr3 values when unpinning pagetables

patch 9f79991d4186089e228274196413572cc000143b in mainline.

When a pagetable is no longer in use, it must be unpinned so that its
pages can be freed.  However, this is only possible if there are no
stray uses of the pagetable.  The code currently deals with all the
usual cases, but there's a rare case where a vcpu is changing cr3, but
is doing so lazily, and the change hasn't actually happened by the time
the pagetable is unpinned, even though it appears to have been completed.

This change adds a second per-cpu cr3 variable - xen_current_cr3 -
which tracks the actual state of the vcpu cr3.  It is only updated once
the actual hypercall to set cr3 has been completed.  Other processors
wishing to unpin a pagetable can check other vcpu's xen_current_cr3
values to see if any cross-cpu IPIs are needed to clean things up.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/i386/xen/enlighten.c
arch/i386/xen/mmu.c
arch/i386/xen/xen-ops.h