aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/lguest/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/lguest/boot.c')
-rw-r--r--arch/x86/lguest/boot.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 960a8d9c049c..9fe4ddaa8f6f 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -173,24 +173,29 @@ static unsigned long save_fl(void)
173{ 173{
174 return lguest_data.irq_enabled; 174 return lguest_data.irq_enabled;
175} 175}
176PV_CALLEE_SAVE_REGS_THUNK(save_fl);
176 177
177/* restore_flags() just sets the flags back to the value given. */ 178/* restore_flags() just sets the flags back to the value given. */
178static void restore_fl(unsigned long flags) 179static void restore_fl(unsigned long flags)
179{ 180{
180 lguest_data.irq_enabled = flags; 181 lguest_data.irq_enabled = flags;
181} 182}
183PV_CALLEE_SAVE_REGS_THUNK(restore_fl);
182 184
183/* Interrupts go off... */ 185/* Interrupts go off... */
184static void irq_disable(void) 186static void irq_disable(void)
185{ 187{
186 lguest_data.irq_enabled = 0; 188 lguest_data.irq_enabled = 0;
187} 189}
190PV_CALLEE_SAVE_REGS_THUNK(irq_disable);
188 191
189/* Interrupts go on... */ 192/* Interrupts go on... */
190static void irq_enable(void) 193static void irq_enable(void)
191{ 194{
192 lguest_data.irq_enabled = X86_EFLAGS_IF; 195 lguest_data.irq_enabled = X86_EFLAGS_IF;
193} 196}
197PV_CALLEE_SAVE_REGS_THUNK(irq_enable);
198
194/*:*/ 199/*:*/
195/*M:003 Note that we don't check for outstanding interrupts when we re-enable 200/*M:003 Note that we don't check for outstanding interrupts when we re-enable
196 * them (or when we unmask an interrupt). This seems to work for the moment, 201 * them (or when we unmask an interrupt). This seems to work for the moment,
@@ -278,7 +283,7 @@ static void lguest_load_tls(struct thread_struct *t, unsigned int cpu)
278 /* There's one problem which normal hardware doesn't have: the Host 283 /* There's one problem which normal hardware doesn't have: the Host
279 * can't handle us removing entries we're currently using. So we clear 284 * can't handle us removing entries we're currently using. So we clear
280 * the GS register here: if it's needed it'll be reloaded anyway. */ 285 * the GS register here: if it's needed it'll be reloaded anyway. */
281 loadsegment(gs, 0); 286 lazy_load_gs(0);
282 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0); 287 lazy_hcall(LHCALL_LOAD_TLS, __pa(&t->tls_array), cpu, 0);
283} 288}
284 289
@@ -830,13 +835,14 @@ static u32 lguest_apic_safe_wait_icr_idle(void)
830 return 0; 835 return 0;
831} 836}
832 837
833static struct apic_ops lguest_basic_apic_ops = { 838static void set_lguest_basic_apic_ops(void)
834 .read = lguest_apic_read, 839{
835 .write = lguest_apic_write, 840 apic->read = lguest_apic_read;
836 .icr_read = lguest_apic_icr_read, 841 apic->write = lguest_apic_write;
837 .icr_write = lguest_apic_icr_write, 842 apic->icr_read = lguest_apic_icr_read;
838 .wait_icr_idle = lguest_apic_wait_icr_idle, 843 apic->icr_write = lguest_apic_icr_write;
839 .safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle, 844 apic->wait_icr_idle = lguest_apic_wait_icr_idle;
845 apic->safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle;
840}; 846};
841#endif 847#endif
842 848
@@ -991,10 +997,10 @@ __init void lguest_init(void)
991 997
992 /* interrupt-related operations */ 998 /* interrupt-related operations */
993 pv_irq_ops.init_IRQ = lguest_init_IRQ; 999 pv_irq_ops.init_IRQ = lguest_init_IRQ;
994 pv_irq_ops.save_fl = save_fl; 1000 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
995 pv_irq_ops.restore_fl = restore_fl; 1001 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(restore_fl);
996 pv_irq_ops.irq_disable = irq_disable; 1002 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable);
997 pv_irq_ops.irq_enable = irq_enable; 1003 pv_irq_ops.irq_enable = PV_CALLEE_SAVE(irq_enable);
998 pv_irq_ops.safe_halt = lguest_safe_halt; 1004 pv_irq_ops.safe_halt = lguest_safe_halt;
999 1005
1000 /* init-time operations */ 1006 /* init-time operations */
@@ -1037,7 +1043,7 @@ __init void lguest_init(void)
1037 1043
1038#ifdef CONFIG_X86_LOCAL_APIC 1044#ifdef CONFIG_X86_LOCAL_APIC
1039 /* apic read/write intercepts */ 1045 /* apic read/write intercepts */
1040 apic_ops = &lguest_basic_apic_ops; 1046 set_lguest_basic_apic_ops();
1041#endif 1047#endif
1042 1048
1043 /* time operations */ 1049 /* time operations */