diff options
Diffstat (limited to 'arch/x86/kernel/paravirt.c')
-rw-r--r-- | arch/x86/kernel/paravirt.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 5eea9548216b..430a0e30577b 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -252,7 +252,7 @@ static inline void enter_lazy(enum paravirt_lazy_mode mode) | |||
252 | __get_cpu_var(paravirt_lazy_mode) = mode; | 252 | __get_cpu_var(paravirt_lazy_mode) = mode; |
253 | } | 253 | } |
254 | 254 | ||
255 | void paravirt_leave_lazy(enum paravirt_lazy_mode mode) | 255 | static void leave_lazy(enum paravirt_lazy_mode mode) |
256 | { | 256 | { |
257 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != mode); | 257 | BUG_ON(__get_cpu_var(paravirt_lazy_mode) != mode); |
258 | BUG_ON(preemptible()); | 258 | BUG_ON(preemptible()); |
@@ -267,17 +267,24 @@ void paravirt_enter_lazy_mmu(void) | |||
267 | 267 | ||
268 | void paravirt_leave_lazy_mmu(void) | 268 | void paravirt_leave_lazy_mmu(void) |
269 | { | 269 | { |
270 | paravirt_leave_lazy(PARAVIRT_LAZY_MMU); | 270 | leave_lazy(PARAVIRT_LAZY_MMU); |
271 | } | 271 | } |
272 | 272 | ||
273 | void paravirt_enter_lazy_cpu(void) | 273 | void paravirt_enter_lazy_cpu(void) |
274 | { | 274 | { |
275 | if (percpu_read(paravirt_lazy_mode) == PARAVIRT_LAZY_MMU) { | ||
276 | arch_leave_lazy_mmu_mode(); | ||
277 | set_thread_flag(TIF_LAZY_MMU_UPDATES); | ||
278 | } | ||
275 | enter_lazy(PARAVIRT_LAZY_CPU); | 279 | enter_lazy(PARAVIRT_LAZY_CPU); |
276 | } | 280 | } |
277 | 281 | ||
278 | void paravirt_leave_lazy_cpu(void) | 282 | void paravirt_leave_lazy_cpu(void) |
279 | { | 283 | { |
280 | paravirt_leave_lazy(PARAVIRT_LAZY_CPU); | 284 | leave_lazy(PARAVIRT_LAZY_CPU); |
285 | |||
286 | if (test_and_clear_thread_flag(TIF_LAZY_MMU_UPDATES)) | ||
287 | arch_enter_lazy_mmu_mode(); | ||
281 | } | 288 | } |
282 | 289 | ||
283 | enum paravirt_lazy_mode paravirt_get_lazy_mode(void) | 290 | enum paravirt_lazy_mode paravirt_get_lazy_mode(void) |