linux/arch/x86/xen
Jeremy Fitzhardinge 9f79991d41 xen: deal with stale cr3 values when unpinning pagetables
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.

[ Stable folks: 2.6.23 bugfix ]

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Stable Kernel <stable@kernel.org>
2007-10-16 11:51:30 -07:00
..
enlighten.c xen: deal with stale cr3 values when unpinning pagetables 2007-10-16 11:51:30 -07:00
events.c i386: move xen 2007-10-11 11:16:51 +02:00
features.c i386: move xen 2007-10-11 11:16:51 +02:00
Kconfig i386: move xen 2007-10-11 11:16:51 +02:00
Makefile i386: move xen 2007-10-11 11:16:51 +02:00
manage.c i386: move xen 2007-10-11 11:16:51 +02:00
mmu.c xen: deal with stale cr3 values when unpinning pagetables 2007-10-16 11:51:30 -07:00
mmu.h i386: move xen 2007-10-11 11:16:51 +02:00
multicalls.c xen: add batch completion callbacks 2007-10-16 11:51:30 -07:00
multicalls.h xen: add batch completion callbacks 2007-10-16 11:51:30 -07:00
setup.c i386: move xen 2007-10-11 11:16:51 +02:00
smp.c xen: yield to IPI target if necessary 2007-10-16 11:51:30 -07:00
time.c xen: yield to IPI target if necessary 2007-10-16 11:51:30 -07:00
vdso.h i386: move xen 2007-10-11 11:16:51 +02:00
xen-asm.S i386: move xen 2007-10-11 11:16:51 +02:00
xen-head.S i386: move xen 2007-10-11 11:16:51 +02:00
xen-ops.h xen: deal with stale cr3 values when unpinning pagetables 2007-10-16 11:51:30 -07:00