]> Pileus Git - ~andy/linux/blobdiff - arch/x86/power/cpu.c
Merge branch 'x86-paravirt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / arch / x86 / power / cpu.c
index 3c68768d7a75963d8825f65b3ac28fff2f257361..6d6e907cee4688273e9848b0cfae0149a46d71e4 100644 (file)
@@ -62,11 +62,9 @@ static void __save_processor_state(struct saved_context *ctxt)
         * descriptor tables
         */
 #ifdef CONFIG_X86_32
-       store_gdt(&ctxt->gdt);
        store_idt(&ctxt->idt);
 #else
 /* CONFIG_X86_64 */
-       store_gdt((struct desc_ptr *)&ctxt->gdt_limit);
        store_idt((struct desc_ptr *)&ctxt->idt_limit);
 #endif
        store_tr(ctxt->tr);
@@ -135,7 +133,10 @@ static void fix_processor_context(void)
 {
        int cpu = smp_processor_id();
        struct tss_struct *t = &per_cpu(init_tss, cpu);
-
+#ifdef CONFIG_X86_64
+       struct desc_struct *desc = get_cpu_gdt_table(cpu);
+       tss_desc tss;
+#endif
        set_tss_desc(cpu, t);   /*
                                 * This just modifies memory; should not be
                                 * necessary. But... This is necessary, because
@@ -144,7 +145,9 @@ static void fix_processor_context(void)
                                 */
 
 #ifdef CONFIG_X86_64
-       get_cpu_gdt_table(cpu)[GDT_ENTRY_TSS].type = 9;
+       memcpy(&tss, &desc[GDT_ENTRY_TSS], sizeof(tss_desc));
+       tss.type = 0x9; /* The available 64-bit TSS (see AMD vol 2, pg 91 */
+       write_gdt_entry(desc, GDT_ENTRY_TSS, &tss, DESC_TSS);
 
        syscall_init();                         /* This sets MSR_*STAR and related */
 #endif
@@ -183,11 +186,9 @@ static void __restore_processor_state(struct saved_context *ctxt)
         * ltr is done i fix_processor_context().
         */
 #ifdef CONFIG_X86_32
-       load_gdt(&ctxt->gdt);
        load_idt(&ctxt->idt);
 #else
 /* CONFIG_X86_64 */
-       load_gdt((const struct desc_ptr *)&ctxt->gdt_limit);
        load_idt((const struct desc_ptr *)&ctxt->idt_limit);
 #endif