diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-02-18 02:46:21 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-03-30 02:36:00 -0400 |
commit | b407fc57b815b2016186220baabc76cc8264206e (patch) | |
tree | 29949f727af8b6c19fd689fa10f123ea84c03cb0 /arch/x86/xen | |
parent | 7fd7d83d49914f03aefffba6aee09032fcd54cce (diff) |
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>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/enlighten.c | 6 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 7 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h | 1 |
3 files changed, 9 insertions, 5 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 82cd39a6cbd3..f586e63b9a63 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -203,10 +203,10 @@ static unsigned long xen_get_debugreg(int reg) | |||
203 | return HYPERVISOR_get_debugreg(reg); | 203 | return HYPERVISOR_get_debugreg(reg); |
204 | } | 204 | } |
205 | 205 | ||
206 | void xen_leave_lazy(void) | 206 | static void xen_leave_lazy_cpu(void) |
207 | { | 207 | { |
208 | paravirt_leave_lazy(paravirt_get_lazy_mode()); | ||
209 | xen_mc_flush(); | 208 | xen_mc_flush(); |
209 | paravirt_leave_lazy_cpu(); | ||
210 | } | 210 | } |
211 | 211 | ||
212 | static unsigned long xen_store_tr(void) | 212 | static unsigned long xen_store_tr(void) |
@@ -819,7 +819,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = { | |||
819 | 819 | ||
820 | .lazy_mode = { | 820 | .lazy_mode = { |
821 | .enter = paravirt_enter_lazy_cpu, | 821 | .enter = paravirt_enter_lazy_cpu, |
822 | .leave = xen_leave_lazy, | 822 | .leave = xen_leave_lazy_cpu, |
823 | }, | 823 | }, |
824 | }; | 824 | }; |
825 | 825 | ||
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 6b98f87232ac..f5f8faa4f76c 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1816,6 +1816,11 @@ __init void xen_post_allocator_init(void) | |||
1816 | xen_mark_init_mm_pinned(); | 1816 | xen_mark_init_mm_pinned(); |
1817 | } | 1817 | } |
1818 | 1818 | ||
1819 | static void xen_leave_lazy_mmu(void) | ||
1820 | { | ||
1821 | xen_mc_flush(); | ||
1822 | paravirt_leave_lazy_mmu(); | ||
1823 | } | ||
1819 | 1824 | ||
1820 | const struct pv_mmu_ops xen_mmu_ops __initdata = { | 1825 | const struct pv_mmu_ops xen_mmu_ops __initdata = { |
1821 | .pagetable_setup_start = xen_pagetable_setup_start, | 1826 | .pagetable_setup_start = xen_pagetable_setup_start, |
@@ -1891,7 +1896,7 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1891 | 1896 | ||
1892 | .lazy_mode = { | 1897 | .lazy_mode = { |
1893 | .enter = paravirt_enter_lazy_mmu, | 1898 | .enter = paravirt_enter_lazy_mmu, |
1894 | .leave = xen_leave_lazy, | 1899 | .leave = xen_leave_lazy_mmu, |
1895 | }, | 1900 | }, |
1896 | 1901 | ||
1897 | .set_fixmap = xen_set_fixmap, | 1902 | .set_fixmap = xen_set_fixmap, |
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 2f5ef2632ea2..f897cdffccb6 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
@@ -30,7 +30,6 @@ pgd_t *xen_setup_kernel_pagetable(pgd_t *pgd, unsigned long max_pfn); | |||
30 | void xen_ident_map_ISA(void); | 30 | void xen_ident_map_ISA(void); |
31 | void xen_reserve_top(void); | 31 | void xen_reserve_top(void); |
32 | 32 | ||
33 | void xen_leave_lazy(void); | ||
34 | void xen_post_allocator_init(void); | 33 | void xen_post_allocator_init(void); |
35 | 34 | ||
36 | char * __init xen_memory_setup(void); | 35 | char * __init xen_memory_setup(void); |