diff options
Diffstat (limited to 'arch/x86/xen/mmu.c')
-rw-r--r-- | arch/x86/xen/mmu.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index fba55b1a4021..4ceb28581652 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -452,10 +452,6 @@ void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) | |||
452 | void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, | 452 | void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, |
453 | pte_t *ptep, pte_t pteval) | 453 | pte_t *ptep, pte_t pteval) |
454 | { | 454 | { |
455 | /* updates to init_mm may be done without lock */ | ||
456 | if (mm == &init_mm) | ||
457 | preempt_disable(); | ||
458 | |||
459 | ADD_STATS(set_pte_at, 1); | 455 | ADD_STATS(set_pte_at, 1); |
460 | // ADD_STATS(set_pte_at_pinned, xen_page_pinned(ptep)); | 456 | // ADD_STATS(set_pte_at_pinned, xen_page_pinned(ptep)); |
461 | ADD_STATS(set_pte_at_current, mm == current->mm); | 457 | ADD_STATS(set_pte_at_current, mm == current->mm); |
@@ -476,9 +472,7 @@ void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, | |||
476 | } | 472 | } |
477 | xen_set_pte(ptep, pteval); | 473 | xen_set_pte(ptep, pteval); |
478 | 474 | ||
479 | out: | 475 | out: return; |
480 | if (mm == &init_mm) | ||
481 | preempt_enable(); | ||
482 | } | 476 | } |
483 | 477 | ||
484 | pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, | 478 | pte_t xen_ptep_modify_prot_start(struct mm_struct *mm, |
@@ -1152,10 +1146,8 @@ static void drop_other_mm_ref(void *info) | |||
1152 | 1146 | ||
1153 | /* If this cpu still has a stale cr3 reference, then make sure | 1147 | /* If this cpu still has a stale cr3 reference, then make sure |
1154 | it has been flushed. */ | 1148 | it has been flushed. */ |
1155 | if (percpu_read(xen_current_cr3) == __pa(mm->pgd)) { | 1149 | if (percpu_read(xen_current_cr3) == __pa(mm->pgd)) |
1156 | load_cr3(swapper_pg_dir); | 1150 | load_cr3(swapper_pg_dir); |
1157 | arch_flush_lazy_cpu_mode(); | ||
1158 | } | ||
1159 | } | 1151 | } |
1160 | 1152 | ||
1161 | static void xen_drop_mm_ref(struct mm_struct *mm) | 1153 | static void xen_drop_mm_ref(struct mm_struct *mm) |
@@ -1168,7 +1160,6 @@ static void xen_drop_mm_ref(struct mm_struct *mm) | |||
1168 | load_cr3(swapper_pg_dir); | 1160 | load_cr3(swapper_pg_dir); |
1169 | else | 1161 | else |
1170 | leave_mm(smp_processor_id()); | 1162 | leave_mm(smp_processor_id()); |
1171 | arch_flush_lazy_cpu_mode(); | ||
1172 | } | 1163 | } |
1173 | 1164 | ||
1174 | /* Get the "official" set of cpus referring to our pagetable. */ | 1165 | /* Get the "official" set of cpus referring to our pagetable. */ |
@@ -1876,6 +1867,14 @@ __init void xen_post_allocator_init(void) | |||
1876 | xen_mark_init_mm_pinned(); | 1867 | xen_mark_init_mm_pinned(); |
1877 | } | 1868 | } |
1878 | 1869 | ||
1870 | static void xen_leave_lazy_mmu(void) | ||
1871 | { | ||
1872 | preempt_disable(); | ||
1873 | xen_mc_flush(); | ||
1874 | paravirt_leave_lazy_mmu(); | ||
1875 | preempt_enable(); | ||
1876 | } | ||
1877 | |||
1879 | const struct pv_mmu_ops xen_mmu_ops __initdata = { | 1878 | const struct pv_mmu_ops xen_mmu_ops __initdata = { |
1880 | .pagetable_setup_start = xen_pagetable_setup_start, | 1879 | .pagetable_setup_start = xen_pagetable_setup_start, |
1881 | .pagetable_setup_done = xen_pagetable_setup_done, | 1880 | .pagetable_setup_done = xen_pagetable_setup_done, |
@@ -1949,7 +1948,7 @@ const struct pv_mmu_ops xen_mmu_ops __initdata = { | |||
1949 | 1948 | ||
1950 | .lazy_mode = { | 1949 | .lazy_mode = { |
1951 | .enter = paravirt_enter_lazy_mmu, | 1950 | .enter = paravirt_enter_lazy_mmu, |
1952 | .leave = xen_leave_lazy, | 1951 | .leave = xen_leave_lazy_mmu, |
1953 | }, | 1952 | }, |
1954 | 1953 | ||
1955 | .set_fixmap = xen_set_fixmap, | 1954 | .set_fixmap = xen_set_fixmap, |