diff options
author | Mike Larkin <mlarkin@cvs.openbsd.org> | 2013-10-18 15:08:00 +0000 |
---|---|---|
committer | Mike Larkin <mlarkin@cvs.openbsd.org> | 2013-10-18 15:08:00 +0000 |
commit | 5c3dc36d46f51128b3385cee73c953a3661e7da6 (patch) | |
tree | 2e1fb1bd6bae7a7c21853be2bb7176afd6a49e9b /sys/arch | |
parent | 9f63416d15096b79063ccdbdf65f18ac9e8e016f (diff) |
Disable global page mappings before we start to unpack. This was likely
one cause of the random gzip errors and reboots we've been seeing with
hibernate as we were creating new mappings for kernel text which likely
conflicted with the non-flushed global mappings from the resuming kernel.
Also remove an unnecessary wbinvd (i386)
ok deraadt
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amd64/amd64/acpi_wakecode.S | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/acpi_wakecode.S | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S index 6680c3bf7b2..5df41e82c22 100644 --- a/sys/arch/amd64/amd64/acpi_wakecode.S +++ b/sys/arch/amd64/amd64/acpi_wakecode.S @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_wakecode.S,v 1.19 2013/08/03 09:39:29 mlarkin Exp $ */ +/* $OpenBSD: acpi_wakecode.S,v 1.20 2013/10/18 15:07:58 mlarkin Exp $ */ /* * Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org> * Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org> @@ -468,8 +468,12 @@ NENTRY(hibernate_activate_resume_pt_machdep) /* Enable large pages */ movq %cr4, %rax orq $(CR4_PSE), %rax + + /* Disable global pages */ + andq $(~CR4_PGE), %rax movq %rax, %cr4 + wbinvd movq $HIBERNATE_PML4T, %rax movq %rax, %cr3 jmp 1f diff --git a/sys/arch/i386/i386/acpi_wakecode.S b/sys/arch/i386/i386/acpi_wakecode.S index 0da8880ebf4..b53da19bac9 100644 --- a/sys/arch/i386/i386/acpi_wakecode.S +++ b/sys/arch/i386/i386/acpi_wakecode.S @@ -373,8 +373,12 @@ NENTRY(hibernate_activate_resume_pt_machdep) /* Enable large pages */ movl %cr4, %eax orl $(CR4_PSE), %eax + + /* Disable global pages */ + andl $(~CR4_PGE), %eax movl %eax, %cr4 + wbinvd movl $HIBERNATE_PD_PAGE, %eax movl %eax, %cr3 jmp 1f @@ -395,7 +399,6 @@ NENTRY(hibernate_switch_stack_machdep) ret NENTRY(hibernate_flush) - wbinvd invlpg HIBERNATE_INFLATE_PAGE ret #endif /* HIBERNATE */ |