aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@xensource.com>2008-04-17 11:40:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:51 -0400
commit81e103f1f1bb0d35000f0e99626bf7abf864b486 (patch)
tree24c630827ecd534f4bf0219e2d1b511d9dec147a /arch/x86/xen
parentc9cf39ae64a6c86872e580f921afec64ab9770f8 (diff)
xen: use iret instruction all the time
Change iret implementation to not be dependent on direct-access vcpu structure. Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r--arch/x86/xen/enlighten.c3
-rw-r--r--arch/x86/xen/xen-asm.S11
-rw-r--r--arch/x86/xen/xen-ops.h2
3 files changed, 5 insertions, 11 deletions
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 198db49106b2..c0388220cf97 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -890,7 +890,6 @@ void __init xen_setup_vcpu_info_placement(void)
890 pv_irq_ops.irq_disable = xen_irq_disable_direct; 890 pv_irq_ops.irq_disable = xen_irq_disable_direct;
891 pv_irq_ops.irq_enable = xen_irq_enable_direct; 891 pv_irq_ops.irq_enable = xen_irq_enable_direct;
892 pv_mmu_ops.read_cr2 = xen_read_cr2_direct; 892 pv_mmu_ops.read_cr2 = xen_read_cr2_direct;
893 pv_cpu_ops.iret = xen_iret_direct;
894 } 893 }
895} 894}
896 895
@@ -994,7 +993,7 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
994 .read_tsc = native_read_tsc, 993 .read_tsc = native_read_tsc,
995 .read_pmc = native_read_pmc, 994 .read_pmc = native_read_pmc,
996 995
997 .iret = (void *)&hypercall_page[__HYPERVISOR_iret], 996 .iret = xen_iret,
998 .irq_enable_syscall_ret = NULL, /* never called */ 997 .irq_enable_syscall_ret = NULL, /* never called */
999 998
1000 .load_tr_desc = paravirt_nop, 999 .load_tr_desc = paravirt_nop,
diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 6b7190449d07..fe161ed4b01e 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -135,13 +135,8 @@ ENDPATCH(xen_restore_fl_direct)
135 current stack state in whatever form its in, we keep things 135 current stack state in whatever form its in, we keep things
136 simple by only using a single register which is pushed/popped 136 simple by only using a single register which is pushed/popped
137 on the stack. 137 on the stack.
138
139 Non-direct iret could be done in the same way, but it would
140 require an annoying amount of code duplication. We'll assume
141 that direct mode will be the common case once the hypervisor
142 support becomes commonplace.
143 */ 138 */
144ENTRY(xen_iret_direct) 139ENTRY(xen_iret)
145 /* test eflags for special cases */ 140 /* test eflags for special cases */
146 testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp) 141 testl $(X86_EFLAGS_VM | XEN_EFLAGS_NMI), 8(%esp)
147 jnz hyper_iret 142 jnz hyper_iret
@@ -155,9 +150,9 @@ ENTRY(xen_iret_direct)
155 GET_THREAD_INFO(%eax) 150 GET_THREAD_INFO(%eax)
156 movl TI_cpu(%eax),%eax 151 movl TI_cpu(%eax),%eax
157 movl __per_cpu_offset(,%eax,4),%eax 152 movl __per_cpu_offset(,%eax,4),%eax
158 lea per_cpu__xen_vcpu_info(%eax),%eax 153 mov per_cpu__xen_vcpu(%eax),%eax
159#else 154#else
160 movl $per_cpu__xen_vcpu_info, %eax 155 movl per_cpu__xen_vcpu, %eax
161#endif 156#endif
162 157
163 /* check IF state we're restoring */ 158 /* check IF state we're restoring */
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index b02a909bfd4c..956a491ea998 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -63,5 +63,5 @@ DECL_ASM(void, xen_irq_disable_direct, void);
63DECL_ASM(unsigned long, xen_save_fl_direct, void); 63DECL_ASM(unsigned long, xen_save_fl_direct, void);
64DECL_ASM(void, xen_restore_fl_direct, unsigned long); 64DECL_ASM(void, xen_restore_fl_direct, unsigned long);
65 65
66void xen_iret_direct(void); 66void xen_iret(void);
67#endif /* XEN_OPS_H */ 67#endif /* XEN_OPS_H */