Lines Matching refs:ctxt
50 static void __save_processor_state(struct saved_context *ctxt) in __save_processor_state() argument
61 store_idt(&ctxt->idt); in __save_processor_state()
64 store_idt((struct desc_ptr *)&ctxt->idt_limit); in __save_processor_state()
72 ctxt->gdt_desc.size = GDT_SIZE - 1; in __save_processor_state()
73 ctxt->gdt_desc.address = (unsigned long)get_cpu_gdt_table(smp_processor_id()); in __save_processor_state()
75 store_tr(ctxt->tr); in __save_processor_state()
82 savesegment(es, ctxt->es); in __save_processor_state()
83 savesegment(fs, ctxt->fs); in __save_processor_state()
84 savesegment(gs, ctxt->gs); in __save_processor_state()
85 savesegment(ss, ctxt->ss); in __save_processor_state()
88 asm volatile ("movw %%ds, %0" : "=m" (ctxt->ds)); in __save_processor_state()
89 asm volatile ("movw %%es, %0" : "=m" (ctxt->es)); in __save_processor_state()
90 asm volatile ("movw %%fs, %0" : "=m" (ctxt->fs)); in __save_processor_state()
91 asm volatile ("movw %%gs, %0" : "=m" (ctxt->gs)); in __save_processor_state()
92 asm volatile ("movw %%ss, %0" : "=m" (ctxt->ss)); in __save_processor_state()
94 rdmsrl(MSR_FS_BASE, ctxt->fs_base); in __save_processor_state()
95 rdmsrl(MSR_GS_BASE, ctxt->gs_base); in __save_processor_state()
96 rdmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); in __save_processor_state()
99 rdmsrl(MSR_EFER, ctxt->efer); in __save_processor_state()
105 ctxt->cr0 = read_cr0(); in __save_processor_state()
106 ctxt->cr2 = read_cr2(); in __save_processor_state()
107 ctxt->cr3 = read_cr3(); in __save_processor_state()
108 ctxt->cr4 = __read_cr4_safe(); in __save_processor_state()
110 ctxt->cr8 = read_cr8(); in __save_processor_state()
112 ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, in __save_processor_state()
113 &ctxt->misc_enable); in __save_processor_state()
167 static void notrace __restore_processor_state(struct saved_context *ctxt) in __restore_processor_state() argument
169 if (ctxt->misc_enable_saved) in __restore_processor_state()
170 wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); in __restore_processor_state()
176 if (ctxt->cr4) in __restore_processor_state()
177 __write_cr4(ctxt->cr4); in __restore_processor_state()
180 wrmsrl(MSR_EFER, ctxt->efer); in __restore_processor_state()
181 write_cr8(ctxt->cr8); in __restore_processor_state()
182 __write_cr4(ctxt->cr4); in __restore_processor_state()
184 write_cr3(ctxt->cr3); in __restore_processor_state()
185 write_cr2(ctxt->cr2); in __restore_processor_state()
186 write_cr0(ctxt->cr0); in __restore_processor_state()
193 load_idt(&ctxt->idt); in __restore_processor_state()
196 load_idt((const struct desc_ptr *)&ctxt->idt_limit); in __restore_processor_state()
203 loadsegment(es, ctxt->es); in __restore_processor_state()
204 loadsegment(fs, ctxt->fs); in __restore_processor_state()
205 loadsegment(gs, ctxt->gs); in __restore_processor_state()
206 loadsegment(ss, ctxt->ss); in __restore_processor_state()
215 asm volatile ("movw %0, %%ds" :: "r" (ctxt->ds)); in __restore_processor_state()
216 asm volatile ("movw %0, %%es" :: "r" (ctxt->es)); in __restore_processor_state()
217 asm volatile ("movw %0, %%fs" :: "r" (ctxt->fs)); in __restore_processor_state()
218 load_gs_index(ctxt->gs); in __restore_processor_state()
219 asm volatile ("movw %0, %%ss" :: "r" (ctxt->ss)); in __restore_processor_state()
221 wrmsrl(MSR_FS_BASE, ctxt->fs_base); in __restore_processor_state()
222 wrmsrl(MSR_GS_BASE, ctxt->gs_base); in __restore_processor_state()
223 wrmsrl(MSR_KERNEL_GS_BASE, ctxt->gs_kernel_base); in __restore_processor_state()