Lines Matching refs:ctxt
38 static void msr_save_context(struct saved_context *ctxt) in msr_save_context() argument
40 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_save_context()
41 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_save_context()
50 static void msr_restore_context(struct saved_context *ctxt) in msr_restore_context() argument
52 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_restore_context()
53 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_restore_context()
78 static void __save_processor_state(struct saved_context *ctxt) in __save_processor_state() argument
88 store_idt(&ctxt->idt); in __save_processor_state()
96 ctxt->gdt_desc.size = GDT_SIZE - 1; in __save_processor_state()
97 ctxt->gdt_desc.address = (unsigned long)get_cpu_gdt_rw(smp_processor_id()); in __save_processor_state()
99 store_tr(ctxt->tr); in __save_processor_state()
105 savesegment(gs, ctxt->gs); in __save_processor_state()
107 savesegment(fs, ctxt->fs); in __save_processor_state()
108 savesegment(ds, ctxt->ds); in __save_processor_state()
109 savesegment(es, ctxt->es); in __save_processor_state()
111 rdmsrl(MSR_FS_BASE, ctxt->fs_base); in __save_processor_state()
112 rdmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __save_processor_state()
113 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __save_processor_state()
116 rdmsrl(MSR_EFER, ctxt->efer); in __save_processor_state()
122 ctxt->cr0 = read_cr0(); in __save_processor_state()
123 ctxt->cr2 = read_cr2(); in __save_processor_state()
124 ctxt->cr3 = __read_cr3(); in __save_processor_state()
125 ctxt->cr4 = __read_cr4(); in __save_processor_state()
126 ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, in __save_processor_state()
127 &ctxt->misc_enable); in __save_processor_state()
128 msr_save_context(ctxt); in __save_processor_state()
194 static void notrace __restore_processor_state(struct saved_context *ctxt) in __restore_processor_state() argument
198 if (ctxt->misc_enable_saved) in __restore_processor_state()
199 wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); in __restore_processor_state()
205 if (ctxt->cr4) in __restore_processor_state()
206 __write_cr4(ctxt->cr4); in __restore_processor_state()
209 wrmsrl(MSR_EFER, ctxt->efer); in __restore_processor_state()
210 __write_cr4(ctxt->cr4); in __restore_processor_state()
212 write_cr3(ctxt->cr3); in __restore_processor_state()
213 write_cr2(ctxt->cr2); in __restore_processor_state()
214 write_cr0(ctxt->cr0); in __restore_processor_state()
217 load_idt(&ctxt->idt); in __restore_processor_state()
232 wrmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __restore_processor_state()
245 loadsegment(ds, ctxt->es); in __restore_processor_state()
246 loadsegment(es, ctxt->es); in __restore_processor_state()
247 loadsegment(fs, ctxt->fs); in __restore_processor_state()
248 load_gs_index(ctxt->gs); in __restore_processor_state()
255 wrmsrl(MSR_FS_BASE, ctxt->fs_base); in __restore_processor_state()
256 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __restore_processor_state()
258 loadsegment(gs, ctxt->gs); in __restore_processor_state()
277 msr_restore_context(ctxt); in __restore_processor_state()