summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormlarkin <mlarkin@openbsd.org>2014-01-10 22:34:41 +0000
committermlarkin <mlarkin@openbsd.org>2014-01-10 22:34:41 +0000
commitc25a1d7d7351433cc7e87c4e2ef3fe3247cbcf10 (patch)
treedebcc4879961fe30e0cdfcf3e54ef21a5b1ca86f
parentAdd the ULT Haswell host bridge id. (diff)
downloadwireguard-openbsd-c25a1d7d7351433cc7e87c4e2ef3fe3247cbcf10.tar.xz
wireguard-openbsd-c25a1d7d7351433cc7e87c4e2ef3fe3247cbcf10.zip
Resurrect the "park APs in realmode" idea that we explored back at t2k13
(and which didn't work at that time due to a bug which has since been fixed). The APs are now demoted to real mode and placed in a HLT loop while the hibernated image is being unpacked. Helps my x230 significantly, no more spurious reboots on resume. ok deraadt
-rw-r--r--sys/arch/amd64/amd64/acpi_wakecode.S12
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c10
2 files changed, 13 insertions, 9 deletions
diff --git a/sys/arch/amd64/amd64/acpi_wakecode.S b/sys/arch/amd64/amd64/acpi_wakecode.S
index e8c54e7a14f..670568eb4ed 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.23 2014/01/05 20:23:56 mlarkin Exp $ */
+/* $OpenBSD: acpi_wakecode.S,v 1.24 2014/01/10 22:34:41 mlarkin Exp $ */
/*
* Copyright (c) 2001 Takanori Watanabe <takawata@jp.freebsd.org>
* Copyright (c) 2001 Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
@@ -394,12 +394,12 @@ _ACPI_TRMP_LABEL(hibernate_resume_vector_2)
/* Get out of 64 bit CS */
lgdtq tmp_gdt6416
- rex64 ljmp *(hibernate_indirect_16)
+ rex64 ljmpq *(hibernate_indirect_16)
_ACPI_TRMP_LABEL(hibernate_indirect_16)
.quad hibernate_resume_vector_3
.word 0x18
-_ACPI_TRMP_LABEL(hibernate_resume_vector_3)
+_ACPI_TRMP_OFFSET(hibernate_resume_vector_3)
.code16
movl %cr0, %eax
@@ -432,12 +432,12 @@ _ACPI_TRMP_LABEL(hibernate_resume_vector_2b)
/* Get out of 64 bit CS */
lgdtq tmp_gdt6416
- rex64 ljmp *(hibernate_indirect_16b)
+ rex64 ljmpq *(hibernate_indirect_16b)
_ACPI_TRMP_LABEL(hibernate_indirect_16b)
.quad hibernate_resume_vector_3b
.word 0x18
-_ACPI_TRMP_LABEL(hibernate_resume_vector_3b)
+_ACPI_TRMP_OFFSET(hibernate_resume_vector_3b)
.code16
movl %cr0, %eax
@@ -622,7 +622,7 @@ _ACPI_TRMP_LABEL(tmp_gdtable6416)
.quad 0x0000000000000000
.quad 0x00af9a000000ffff
.quad 0x00cf92000000ffff
- .quad 0x00009a000000ffff
+ .quad 0x00009a0110000fff
_ACPI_TRMP_LABEL(tmp_gdt6416_end)
.align 4
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index 4d429770751..8143947bd4d 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_machdep.c,v 1.18 2014/01/05 23:06:54 mlarkin Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.19 2014/01/10 22:34:41 mlarkin Exp $ */
/*
* Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org>
@@ -398,7 +398,11 @@ hibernate_quiesce_cpus(void)
/* Start the hatched (but idling) APs */
cpu_boot_secondary_processors();
- /* Now shut them down */
- acpi_sleep_mp();
+ /* Demote the APs to real mode */
+ x86_broadcast_ipi(X86_IPI_HALT_REALMODE);
+
+ /* Wait a bit for the APs to park themselves */
+ delay(1000000);
+
}
#endif /* MULTIPROCESSOR */