diff options
author | Jeremy Fitzhardinge <jeremy@xensource.com> | 2007-10-16 14:51:30 -0400 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy@goop.org> | 2007-10-16 14:51:30 -0400 |
commit | 9f79991d4186089e228274196413572cc000143b (patch) | |
tree | cd50a308dca1d650ab77c7019ff3bdcadc7ab0ea /arch/x86/xen/xen-ops.h | |
parent | 91e0c5f3dad47838cb2ecc1865ce789a0b7182b1 (diff) |
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>
Diffstat (limited to 'arch/x86/xen/xen-ops.h')
-rw-r--r-- | arch/x86/xen/xen-ops.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 3847eed0bb09..b02a909bfd4c 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -11,6 +11,7 @@ void xen_copy_trap_info(struct trap_info *traps); | |||
11 | 11 | ||
12 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); | 12 | DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); |
13 | DECLARE_PER_CPU(unsigned long, xen_cr3); | 13 | DECLARE_PER_CPU(unsigned long, xen_cr3); |
14 | DECLARE_PER_CPU(unsigned long, xen_current_cr3); | ||
14 | 15 | ||
15 | extern struct start_info *xen_start_info; | 16 | extern struct start_info *xen_start_info; |
16 | extern struct shared_info *HYPERVISOR_shared_info; | 17 | extern struct shared_info *HYPERVISOR_shared_info; |