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 92f1c6f3e19d..f3a5305b8adf 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
@@ -823,13 +828,14 @@ static u32 lguest_apic_safe_wait_icr_idle(void)
823 return 0; 828 return 0;
824} 829}
825 830
826static struct apic_ops lguest_basic_apic_ops = { 831static void set_lguest_basic_apic_ops(void)
827 .read = lguest_apic_read, 832{
828 .write = lguest_apic_write, 833 apic->read = lguest_apic_read;
829 .icr_read = lguest_apic_icr_read, 834 apic->write = lguest_apic_write;
830 .icr_write = lguest_apic_icr_write, 835 apic->icr_read = lguest_apic_icr_read;
831 .wait_icr_idle = lguest_apic_wait_icr_idle, 836 apic->icr_write = lguest_apic_icr_write;
832 .safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle, 837 apic->wait_icr_idle = lguest_apic_wait_icr_idle;
838 apic->safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle;
833}; 839};
834#endif 840#endif
835 841
@@ -984,10 +990,10 @@ __init void lguest_init(void)
984 990
985 /* interrupt-related operations */ 991 /* interrupt-related operations */
986 pv_irq_ops.init_IRQ = lguest_init_IRQ; 992 pv_irq_ops.init_IRQ = lguest_init_IRQ;
987 pv_irq_ops.save_fl = save_fl; 993 pv_irq_ops.save_fl = PV_CALLEE_SAVE(save_fl);
988 pv_irq_ops.restore_fl = restore_fl; 994 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(restore_fl);
989 pv_irq_ops.irq_disable = irq_disable; 995 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(irq_disable);
990 pv_irq_ops.irq_enable = irq_enable; 996 pv_irq_ops.irq_enable = PV_CALLEE_SAVE(irq_enable);
991 pv_irq_ops.safe_halt = lguest_safe_halt; 997 pv_irq_ops.safe_halt = lguest_safe_halt;
992 998
993 /* init-time operations */ 999 /* init-time operations */
@@ -1030,7 +1036,7 @@ __init void lguest_init(void)
1030 1036
1031#ifdef CONFIG_X86_LOCAL_APIC 1037#ifdef CONFIG_X86_LOCAL_APIC
1032 /* apic read/write intercepts */ 1038 /* apic read/write intercepts */
1033 apic_ops = &lguest_basic_apic_ops; 1039 set_lguest_basic_apic_ops();
1034#endif 1040#endif
1035 1041
1036 /* time operations */ 1042 /* time operations */