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()
77 static void __save_processor_state(struct saved_context *ctxt) in __save_processor_state() argument
87 store_idt(&ctxt->idt); in __save_processor_state()
95 ctxt->gdt_desc.size = GDT_SIZE - 1; in __save_processor_state()
96 ctxt->gdt_desc.address = (unsigned long)get_cpu_gdt_rw(smp_processor_id()); in __save_processor_state()
98 store_tr(ctxt->tr); in __save_processor_state()
105 savesegment(gs, ctxt->gs); in __save_processor_state()
108 savesegment(gs, ctxt->gs); in __save_processor_state()
109 savesegment(fs, ctxt->fs); in __save_processor_state()
110 savesegment(ds, ctxt->ds); in __save_processor_state()
111 savesegment(es, ctxt->es); in __save_processor_state()
113 rdmsrl(MSR_FS_BASE, ctxt->fs_base); in __save_processor_state()
114 rdmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __save_processor_state()
115 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __save_processor_state()
118 rdmsrl(MSR_EFER, ctxt->efer); in __save_processor_state()
124 ctxt->cr0 = read_cr0(); in __save_processor_state()
125 ctxt->cr2 = read_cr2(); in __save_processor_state()
126 ctxt->cr3 = __read_cr3(); in __save_processor_state()
127 ctxt->cr4 = __read_cr4(); in __save_processor_state()
128 ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, in __save_processor_state()
129 &ctxt->misc_enable); in __save_processor_state()
130 msr_save_context(ctxt); in __save_processor_state()
196 static void notrace __restore_processor_state(struct saved_context *ctxt) in __restore_processor_state() argument
200 if (ctxt->misc_enable_saved) in __restore_processor_state()
201 wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); in __restore_processor_state()
207 if (ctxt->cr4) in __restore_processor_state()
208 __write_cr4(ctxt->cr4); in __restore_processor_state()
211 wrmsrl(MSR_EFER, ctxt->efer); in __restore_processor_state()
212 __write_cr4(ctxt->cr4); in __restore_processor_state()
214 write_cr3(ctxt->cr3); in __restore_processor_state()
215 write_cr2(ctxt->cr2); in __restore_processor_state()
216 write_cr0(ctxt->cr0); in __restore_processor_state()
219 load_idt(&ctxt->idt); in __restore_processor_state()
234 wrmsrl(MSR_GS_BASE, ctxt->kernelmode_gs_base); in __restore_processor_state()
248 loadsegment(ds, ctxt->es); in __restore_processor_state()
249 loadsegment(es, ctxt->es); in __restore_processor_state()
250 loadsegment(fs, ctxt->fs); in __restore_processor_state()
251 load_gs_index(ctxt->gs); in __restore_processor_state()
258 wrmsrl(MSR_FS_BASE, ctxt->fs_base); in __restore_processor_state()
259 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->usermode_gs_base); in __restore_processor_state()
261 loadsegment(gs, ctxt->gs); in __restore_processor_state()
280 msr_restore_context(ctxt); in __restore_processor_state()