diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-02-18 14:18:57 -0500 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-03-30 02:36:01 -0400 |
commit | 224101ed69d3fbb486868e0f6e0f9fa37302efb4 (patch) | |
tree | 46830842a99659421eeabee65d299ab4c3b59f28 /arch/x86/include | |
parent | b407fc57b815b2016186220baabc76cc8264206e (diff) |
x86/paravirt: finish change from lazy cpu to context switch start/end
Impact: fix lazy context switch API
Pass the previous and next tasks into the context switch start
end calls, so that the called functions can properly access the
task state (esp in end_context_switch, in which the next task
is not yet completely current).
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/paravirt.h | 17 | ||||
-rw-r--r-- | arch/x86/include/asm/pgtable.h | 2 |
2 files changed, 12 insertions, 7 deletions
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h index 58d2481b01a6..dfdee0ca57d3 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h | |||
@@ -56,6 +56,7 @@ struct desc_ptr; | |||
56 | struct tss_struct; | 56 | struct tss_struct; |
57 | struct mm_struct; | 57 | struct mm_struct; |
58 | struct desc_struct; | 58 | struct desc_struct; |
59 | struct task_struct; | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * Wrapper type for pointers to code which uses the non-standard | 62 | * Wrapper type for pointers to code which uses the non-standard |
@@ -203,7 +204,8 @@ struct pv_cpu_ops { | |||
203 | 204 | ||
204 | void (*swapgs)(void); | 205 | void (*swapgs)(void); |
205 | 206 | ||
206 | struct pv_lazy_ops lazy_mode; | 207 | void (*start_context_switch)(struct task_struct *prev); |
208 | void (*end_context_switch)(struct task_struct *next); | ||
207 | }; | 209 | }; |
208 | 210 | ||
209 | struct pv_irq_ops { | 211 | struct pv_irq_ops { |
@@ -1414,20 +1416,21 @@ enum paravirt_lazy_mode { | |||
1414 | }; | 1416 | }; |
1415 | 1417 | ||
1416 | enum paravirt_lazy_mode paravirt_get_lazy_mode(void); | 1418 | enum paravirt_lazy_mode paravirt_get_lazy_mode(void); |
1417 | void paravirt_enter_lazy_cpu(void); | 1419 | void paravirt_start_context_switch(struct task_struct *prev); |
1418 | void paravirt_leave_lazy_cpu(void); | 1420 | void paravirt_end_context_switch(struct task_struct *next); |
1421 | |||
1419 | void paravirt_enter_lazy_mmu(void); | 1422 | void paravirt_enter_lazy_mmu(void); |
1420 | void paravirt_leave_lazy_mmu(void); | 1423 | void paravirt_leave_lazy_mmu(void); |
1421 | 1424 | ||
1422 | #define __HAVE_ARCH_START_CONTEXT_SWITCH | 1425 | #define __HAVE_ARCH_START_CONTEXT_SWITCH |
1423 | static inline void arch_start_context_switch(void) | 1426 | static inline void arch_start_context_switch(struct task_struct *prev) |
1424 | { | 1427 | { |
1425 | PVOP_VCALL0(pv_cpu_ops.lazy_mode.enter); | 1428 | PVOP_VCALL1(pv_cpu_ops.start_context_switch, prev); |
1426 | } | 1429 | } |
1427 | 1430 | ||
1428 | static inline void arch_end_context_switch(void) | 1431 | static inline void arch_end_context_switch(struct task_struct *next) |
1429 | { | 1432 | { |
1430 | PVOP_VCALL0(pv_cpu_ops.lazy_mode.leave); | 1433 | PVOP_VCALL1(pv_cpu_ops.end_context_switch, next); |
1431 | } | 1434 | } |
1432 | 1435 | ||
1433 | #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE | 1436 | #define __HAVE_ARCH_ENTER_LAZY_MMU_MODE |
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index d0812e155f1d..24e42836e921 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h | |||
@@ -83,6 +83,8 @@ static inline void __init paravirt_pagetable_setup_done(pgd_t *base) | |||
83 | #define pte_val(x) native_pte_val(x) | 83 | #define pte_val(x) native_pte_val(x) |
84 | #define __pte(x) native_make_pte(x) | 84 | #define __pte(x) native_make_pte(x) |
85 | 85 | ||
86 | #define arch_end_context_switch(prev) do {} while(0) | ||
87 | |||
86 | #endif /* CONFIG_PARAVIRT */ | 88 | #endif /* CONFIG_PARAVIRT */ |
87 | 89 | ||
88 | /* | 90 | /* |