Lines Matching refs:ctxt

39 static void msr_save_context(struct saved_context *ctxt)  in msr_save_context()  argument
41 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_save_context()
42 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_save_context()
51 static void msr_restore_context(struct saved_context *ctxt) in msr_restore_context() argument
53 struct saved_msr *msr = ctxt->saved_msrs.array; in msr_restore_context()
54 struct saved_msr *end = msr + ctxt->saved_msrs.num; in msr_restore_context()
79 static void __save_processor_state(struct saved_context *ctxt) in __save_processor_state() argument
89 store_idt(&ctxt->idt); in __save_processor_state()
97 ctxt->gdt_desc.size = GDT_SIZE - 1; in __save_processor_state()
98 ctxt->gdt_desc.address = (unsigned long)get_cpu_gdt_rw(smp_processor_id()); in __save_processor_state()
100 store_tr(ctxt->tr); in __save_processor_state()
106 savesegment(gs, ctxt->gs); in __save_processor_state()
108 savesegment(fs, ctxt->fs); in __save_processor_state()
109 savesegment(ds, ctxt->ds); in __save_processor_state()
110 savesegment(es, ctxt->es); in __save_processor_state()
112 rdmsrl(MSR_FS_BASE, ctxt->fs_base); in __save_processor_state()
113 rdmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __save_processor_state()
114 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __save_processor_state()
117 rdmsrl(MSR_EFER, ctxt->efer); in __save_processor_state()
123 ctxt->cr0 = read_cr0(); in __save_processor_state()
124 ctxt->cr2 = read_cr2(); in __save_processor_state()
125 ctxt->cr3 = __read_cr3(); in __save_processor_state()
126 ctxt->cr4 = __read_cr4(); in __save_processor_state()
127 ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, in __save_processor_state()
128 &ctxt->misc_enable); in __save_processor_state()
129 msr_save_context(ctxt); in __save_processor_state()
195 static void notrace __restore_processor_state(struct saved_context *ctxt) in __restore_processor_state() argument
199 if (ctxt->misc_enable_saved) in __restore_processor_state()
200 wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); in __restore_processor_state()
206 if (ctxt->cr4) in __restore_processor_state()
207 __write_cr4(ctxt->cr4); in __restore_processor_state()
210 wrmsrl(MSR_EFER, ctxt->efer); in __restore_processor_state()
211 __write_cr4(ctxt->cr4); in __restore_processor_state()
213 write_cr3(ctxt->cr3); in __restore_processor_state()
214 write_cr2(ctxt->cr2); in __restore_processor_state()
215 write_cr0(ctxt->cr0); in __restore_processor_state()
218 load_idt(&ctxt->idt); in __restore_processor_state()
233 wrmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __restore_processor_state()
246 loadsegment(ds, ctxt->es); in __restore_processor_state()
247 loadsegment(es, ctxt->es); in __restore_processor_state()
248 loadsegment(fs, ctxt->fs); in __restore_processor_state()
249 load_gs_index(ctxt->gs); in __restore_processor_state()
256 wrmsrl(MSR_FS_BASE, ctxt->fs_base); in __restore_processor_state()
257 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __restore_processor_state()
259 loadsegment(gs, ctxt->gs); in __restore_processor_state()
278 msr_restore_context(ctxt); in __restore_processor_state()