summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2009-11-24 17:00:01 +0000
committermlarkin <mlarkin@openbsd.org>2009-11-24 17:00:01 +0000
commit0dc60ce89ecc35352aaa41f330f4313bcb3b0ea0 (patch)
tree414cbdcf044af57aea91941980928c6f07ee433a
parentPreserve rawmode when setting scale. ok miod@, oga@. (diff)
downloadwireguard-openbsd-0dc60ce89ecc35352aaa41f330f4313bcb3b0ea0.tar.xz
wireguard-openbsd-0dc60ce89ecc35352aaa41f330f4313bcb3b0ea0.zip
Poke CR3 one last time before resuming. Suggested by deraadt@.
ok deraadt@
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S6
-rw-r--r--sys/arch/i386/i386/acpi_wakecode.S4
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index 3b49a1e0569..bd0763d46ab 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.4 2009/11/22 22:00:51 mlarkin Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.5 2009/11/24 17:00:01 mlarkin Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -367,6 +367,10 @@ _C_LABEL(acpi_long_mode_resume):
movq acpi_saved_r14, %r14
movq acpi_saved_r15, %r15
+ /* Poke CR3 one more time. Might not be necessary */
+ movq acpi_saved_cr3, %rax
+ movq %rax, %cr3
+
xorq %rax, %rax
jmp *acpi_saved_ret
diff --git a/sys/arch/i386/i386/acpi_wakecode.S b/sys/arch/i386/i386/acpi_wakecode.S
index 2b0ff810e92..3f80542bf8a 100644
--- a/sys/arch/i386/i386/acpi_wakecode.S
+++ b/sys/arch/i386/i386/acpi_wakecode.S
@@ -305,6 +305,10 @@ _C_LABEL(acpi_protected_mode_resume):
push acpi_saved_fl
popfl
+ /* Poke CR3 one more time. Might not be necessary */
+ movl acpi_saved_cr3,%eax
+ movl %eax,%cr3
+
/*
* Return to the OS. We've previously saved the resume
* address in acpi_saved_ret (via a call to acpi_savecpu