x86/paravirt: flush pending mmu updates on context switch

Impact: allow preemption during lazy mmu updates

If we're in lazy mmu mode when context switching, leave
lazy mmu mode, but remember the task's state in
TIF_LAZY_MMU_UPDATES.  When we resume the task, check this
flag and re-enter lazy mmu mode if its set.

This sets things up for allowing lazy mmu mode while preemptible,
though that won't actually be active until the next change.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
This commit is contained in:
Jeremy Fitzhardinge
2009-02-17 23:46:21 -08:00
parent 7fd7d83d49
commit b407fc57b8
9 changed files with 42 additions and 18 deletions

View File

@@ -203,10 +203,10 @@ static unsigned long xen_get_debugreg(int reg)
return HYPERVISOR_get_debugreg(reg);
}
void xen_leave_lazy(void)
static void xen_leave_lazy_cpu(void)
{
paravirt_leave_lazy(paravirt_get_lazy_mode());
xen_mc_flush();
paravirt_leave_lazy_cpu();
}
static unsigned long xen_store_tr(void)
@@ -819,7 +819,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
.lazy_mode = {
.enter = paravirt_enter_lazy_cpu,
.leave = xen_leave_lazy,
.leave = xen_leave_lazy_cpu,
},
};