From patchwork Sun Mar 13 22:04:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Castet X-Patchwork-Id: 632191 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2DM4bp5022051 for ; Sun, 13 Mar 2011 22:04:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752904Ab1CMWEg (ORCPT ); Sun, 13 Mar 2011 18:04:36 -0400 Received: from smtp6-g21.free.fr ([212.27.42.6]:46255 "EHLO smtp6-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752713Ab1CMWEf (ORCPT ); Sun, 13 Mar 2011 18:04:35 -0400 Received: from [192.168.1.234] (unknown [81.57.151.96]) by smtp6-g21.free.fr (Postfix) with ESMTP id 16DC78228F; Sun, 13 Mar 2011 23:04:27 +0100 (CET) Message-ID: <4D7D3F6B.8060504@free.fr> Date: Sun, 13 Mar 2011 23:04:27 +0100 From: matthieu castet User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18 MIME-Version: 1.0 To: Linux Kernel list , linux-acpi@vger.kernel.org, x86@kernel.org CC: "Rafael J. Wysocki" , "H. Peter Anvin" Subject: [PATCH 2/2] clean acpi wakeup code after merge Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 13 Mar 2011 22:04:37 +0000 (UTC) diff --git a/arch/x86/kernel/acpi/realmode/wakeup.S b/arch/x86/kernel/acpi/realmode/wakeup.S index 150a734..aefa400 100644 --- a/arch/x86/kernel/acpi/realmode/wakeup.S +++ b/arch/x86/kernel/acpi/realmode/wakeup.S @@ -20,14 +20,6 @@ _start: .globl wakeup_header wakeup_header: video_mode: .short 0 /* Video mode number */ -pmode_return: .byte 0x66, 0xea /* ljmpl */ - .long 0 /* offset goes here */ - .short __KERNEL_CS -pmode_cr0: .long 0 /* Saved %cr0 */ -pmode_cr3: .long 0 /* Saved %cr3 */ -pmode_cr4: .long 0 /* Saved %cr4 */ -pmode_efer: .quad 0 /* Saved EFER */ -pmode_gdt: .quad 0 realmode_flags: .long 0 real_magic: .long 0 trampoline_segment: .word 0 diff --git a/arch/x86/kernel/acpi/realmode/wakeup.h b/arch/x86/kernel/acpi/realmode/wakeup.h index e1828c0..5f302e1 100644 --- a/arch/x86/kernel/acpi/realmode/wakeup.h +++ b/arch/x86/kernel/acpi/realmode/wakeup.h @@ -12,18 +12,9 @@ /* This must match data at wakeup.S */ struct wakeup_header { u16 video_mode; /* Video mode number */ - u16 _jmp1; /* ljmpl opcode, 32-bit only */ - u32 pmode_entry; /* Protected mode resume point, 32-bit only */ - u16 _jmp2; /* CS value, 32-bit only */ - u32 pmode_cr0; /* Protected mode cr0 */ - u32 pmode_cr3; /* Protected mode cr3 */ - u32 pmode_cr4; /* Protected mode cr4 */ - u32 pmode_efer_low; /* Protected mode EFER */ - u32 pmode_efer_high; - u64 pmode_gdt; u32 realmode_flags; u32 real_magic; - u16 trampoline_segment; /* segment with trampoline code, 64-bit only */ + u16 trampoline_segment; /* segment with trampoline code */ u8 _pad1; u8 wakeup_jmp; u16 wakeup_jmp_off; diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index 58a0b4b..bab18ed 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c @@ -67,8 +67,6 @@ int acpi_save_state_mem(void) header->wakeup_gdt[2] = GDT_ENTRY(0x8093, acpi_wakeup_address, 0xfffff); - header->pmode_cr0 = read_cr0(); - header->pmode_cr4 = read_cr4_safe(); header->realmode_flags = acpi_realmode_flags; header->real_magic = 0x12345678; header->trampoline_segment = trampoline_address() >> 4; diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S index 13ab720..56f8de4 100644 --- a/arch/x86/kernel/acpi/wakeup_32.S +++ b/arch/x86/kernel/acpi/wakeup_32.S @@ -17,17 +17,7 @@ wakeup_pmode_return: movw %ax, %fs movw %ax, %gs - # reload the gdt, as we need the full 32 bit address - lgdt saved_gdt - lidt saved_idt - lldt saved_ldt - ljmp $(__KERNEL_CS), $1f -1: - movl %cr3, %eax - movl %eax, %cr3 - wbinvd - - # and restore the stack ... but you need gdt for this to work + # and restore the stack ... movl saved_context_esp, %esp movl %cs:saved_magic, %eax @@ -44,11 +34,6 @@ bogus_magic: save_registers: - sgdt saved_gdt - sidt saved_idt - sldt saved_ldt - str saved_tss - leal 4(%esp), %eax movl %eax, saved_context_esp movl %ebx, saved_context_ebx @@ -91,10 +76,3 @@ ret_point: ALIGN ENTRY(saved_magic) .long 0 ENTRY(saved_eip) .long 0 - -# saved registers -saved_gdt: .long 0,0 -saved_idt: .long 0,0 -saved_ldt: .long 0 -saved_tss: .long 0 -