aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64/include/intr_machdep.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2018-01-18 23:50:21 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2018-01-18 23:50:21 +0000
commit68fd3b0ef5d7ff0359e7ae45e16f73127da62ae5 (patch)
tree7d1ad28122d0a5f694588e21c3805da00f2a91bc /sys/amd64/include/intr_machdep.h
parent62821e572020f44989b669223b73678d6393de75 (diff)
downloadsrc-68fd3b0ef5d7ff0359e7ae45e16f73127da62ae5.tar.gz
src-68fd3b0ef5d7ff0359e7ae45e16f73127da62ae5.zip
Use a dedicated per-CPU stack for machine check exceptions.
Similar to NMIs, machine check exceptions can fire at any time and are not masked by IF. This means that machine checks can fire when the kstack is too deep to hold a trap frame, or at critical sections in trap handlers when a user %gs is used with a kernel %cs. Use the same strategy used for NMIs of using a dedicated per-CPU stack configured in IST 3. Store the CPU's pcpu pointer at the stop of the stack so that the machine check handler can reliably find the proper value for %gs (also borrowed from NMIs). This should also fix a similar issue with PTI with a MC# occurring while the CPU is executing on the trampoline stack. While here, bypass trap() entirely and just call mca_intr(). This avoids a bogus call to kdb_reenter() (there's no reason to try to reenter kdb if a MC# is raised). Reviewed by: kib Tested by: avg (on AMD without PTI) Differential Revision: https://reviews.freebsd.org/D13962
Notes
Notes: svn path=/head/; revision=328157
Diffstat (limited to 'sys/amd64/include/intr_machdep.h')
-rw-r--r--sys/amd64/include/intr_machdep.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/amd64/include/intr_machdep.h b/sys/amd64/include/intr_machdep.h
index 47a1a8f19d27..15842696a7a1 100644
--- a/sys/amd64/include/intr_machdep.h
+++ b/sys/amd64/include/intr_machdep.h
@@ -139,7 +139,7 @@ struct trapframe;
/*
* The following data structure holds per-cpu data, and is placed just
- * above the top of the space used for the NMI stack.
+ * above the top of the space used for the NMI and MC# stacks.
*/
struct nmi_pcpu {
register_t np_pcpu;