Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86 ACPI: fix resume from suspend to RAM on uniprocessor x86-64
x86 ACPI: normalize segment descriptor register on resume

+60 -6
+37 -1
arch/x86/kernel/acpi/realmode/wakeup.S
··· 5 5 #include <asm/msr-index.h> 6 6 #include <asm/page.h> 7 7 #include <asm/pgtable.h> 8 + #include <asm/processor-flags.h> 8 9 9 10 .code16 10 11 .section ".header", "a" ··· 25 24 realmode_flags: .long 0 26 25 real_magic: .long 0 27 26 trampoline_segment: .word 0 27 + _pad1: .byte 0 28 + wakeup_jmp: .byte 0xea /* ljmpw */ 29 + wakeup_jmp_off: .word 3f 30 + wakeup_jmp_seg: .word 0 31 + wakeup_gdt: .quad 0, 0, 0 28 32 signature: .long 0x51ee1111 29 33 30 34 .text ··· 40 34 cli 41 35 cld 42 36 37 + /* Apparently some dimwit BIOS programmers don't know how to 38 + program a PM to RM transition, and we might end up here with 39 + junk in the data segment descriptor registers. The only way 40 + to repair that is to go into PM and fix it ourselves... */ 41 + movw $16, %cx 42 + lgdtl %cs:wakeup_gdt 43 + movl %cr0, %eax 44 + orb $X86_CR0_PE, %al 45 + movl %eax, %cr0 46 + jmp 1f 47 + 1: ljmpw $8, $2f 48 + 2: 49 + movw %cx, %ds 50 + movw %cx, %es 51 + movw %cx, %ss 52 + movw %cx, %fs 53 + movw %cx, %gs 54 + 55 + andb $~X86_CR0_PE, %al 56 + movl %eax, %cr0 57 + jmp wakeup_jmp 58 + 3: 43 59 /* Set up segments */ 44 60 movw %cs, %ax 45 61 movw %ax, %ds 46 62 movw %ax, %es 47 63 movw %ax, %ss 64 + lidtl wakeup_idt 48 65 49 66 movl $wakeup_stack_end, %esp 50 67 ··· 127 98 jmp 1b 128 99 129 100 .data 130 - .balign 4 101 + .balign 8 102 + 103 + /* This is the standard real-mode IDT */ 104 + wakeup_idt: 105 + .word 0xffff /* limit */ 106 + .long 0 /* address */ 107 + .word 0 108 + 131 109 .globl HEAP, heap_end 132 110 HEAP: 133 111 .long wakeup_heap
+5
arch/x86/kernel/acpi/realmode/wakeup.h
··· 24 24 u32 realmode_flags; 25 25 u32 real_magic; 26 26 u16 trampoline_segment; /* segment with trampoline code, 64-bit only */ 27 + u8 _pad1; 28 + u8 wakeup_jmp; 29 + u16 wakeup_jmp_off; 30 + u16 wakeup_jmp_seg; 31 + u64 wakeup_gdt[3]; 27 32 u32 signature; /* To check we have correct structure */ 28 33 } __attribute__((__packed__)); 29 34
+15 -1
arch/x86/kernel/acpi/sleep.c
··· 50 50 51 51 header->video_mode = saved_video_mode; 52 52 53 + header->wakeup_jmp_seg = acpi_wakeup_address >> 4; 54 + /* GDT[0]: GDT self-pointer */ 55 + header->wakeup_gdt[0] = 56 + (u64)(sizeof(header->wakeup_gdt) - 1) + 57 + ((u64)(acpi_wakeup_address + 58 + ((char *)&header->wakeup_gdt - (char *)acpi_realmode)) 59 + << 16); 60 + /* GDT[1]: real-mode-like code segment */ 61 + header->wakeup_gdt[1] = (0x009bULL << 40) + 62 + ((u64)acpi_wakeup_address << 16) + 0xffff; 63 + /* GDT[2]: real-mode-like data segment */ 64 + header->wakeup_gdt[2] = (0x0093ULL << 40) + 65 + ((u64)acpi_wakeup_address << 16) + 0xffff; 66 + 53 67 #ifndef CONFIG_64BIT 54 68 store_gdt((struct desc_ptr *)&header->pmode_gdt); 55 69 ··· 125 111 return; 126 112 } 127 113 128 - acpi_wakeup_address = acpi_realmode; 114 + acpi_wakeup_address = virt_to_phys((void *)acpi_realmode); 129 115 } 130 116 131 117
+1 -1
arch/x86/kernel/head_64.S
··· 128 128 /* Fixup phys_base */ 129 129 addq %rbp, phys_base(%rip) 130 130 131 - #ifdef CONFIG_SMP 131 + #ifdef CONFIG_X86_TRAMPOLINE 132 132 addq %rbp, trampoline_level4_pgt + 0(%rip) 133 133 addq %rbp, trampoline_level4_pgt + (511*8)(%rip) 134 134 #endif
+2 -3
drivers/acpi/sleep/main.c
··· 36 36 if (!acpi_wakeup_address) { 37 37 return -EFAULT; 38 38 } 39 - acpi_set_firmware_waking_vector((acpi_physical_address) 40 - virt_to_phys((void *) 41 - acpi_wakeup_address)); 39 + acpi_set_firmware_waking_vector( 40 + (acpi_physical_address)acpi_wakeup_address); 42 41 43 42 } 44 43 ACPI_FLUSH_CPU_CACHE();