aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2018-06-25 11:29:04 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2018-06-25 11:29:04 +0000
commit7f12ebe58305d37fd1f8fb5583bf046c1f0bf51f (patch)
treedaaad158097cc0dfbf762acbd79ca89814825536
parentce3bf750153633b47f8b071a733f1fe8f5dd7e9c (diff)
downloadsrc-7f12ebe58305d37fd1f8fb5583bf046c1f0bf51f.tar.gz
src-7f12ebe58305d37fd1f8fb5583bf046c1f0bf51f.zip
Do not leave stray qword on top of stack for interrupts and exceptions
without error code. Doing so it mis-aligned the stack. Since the only consumer of the SSE instructions with the alignment requirements is AES-NI module, and since the FPU context cannot be accessed in interrupts, the only situation where the alignment matter are the compat32 syscalls, as reported in the PR. PR: 229222 Reported and tested by: dewayne@heuristicsystems.com.au Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes
Notes: svn path=/head/; revision=335635
-rw-r--r--sys/amd64/include/asmacros.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/include/asmacros.h b/sys/amd64/include/asmacros.h
index 11f500267d7e..c4042fa65602 100644
--- a/sys/amd64/include/asmacros.h
+++ b/sys/amd64/include/asmacros.h
@@ -187,7 +187,7 @@
movq PCPU(KCR3),%rax
movq %rax,%cr3
movq PCPU(RSP0),%rax
- subq $PTI_SIZE,%rax
+ subq $PTI_SIZE - 8 * (1 - \has_err),%rax
MOVE_STACKS ((PTI_SIZE / 8) - 1 + \has_err)
movq %rax,%rsp
popq %rdx