[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <159083264044.17951.13942038609089131962.tip-bot2@tip-bot2>
Date: Sat, 30 May 2020 09:57:20 -0000
From: "tip-bot2 for Peter Zijlstra" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Peter Zijlstra (Intel)" <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: x86/entry] x86/entry, mce: Disallow #DB during #MC
The following commit has been merged into the x86/entry branch of tip:
Commit-ID: ff98610a03285516b578821549973f969118d6a3
Gitweb: https://git.kernel.org/tip/ff98610a03285516b578821549973f969118d6a3
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Fri, 29 May 2020 23:27:35 +02:00
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Sat, 30 May 2020 10:00:08 +02:00
x86/entry, mce: Disallow #DB during #MC
#MC is fragile as heck, don't tempt fate.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Link: https://lkml.kernel.org/r/20200529213321.131187767@infradead.org
---
arch/x86/kernel/cpu/mce/core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 068e6ca..be49926 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1943,22 +1943,34 @@ static __always_inline void exc_machine_check_user(struct pt_regs *regs)
/* MCE hit kernel mode */
DEFINE_IDTENTRY_MCE(exc_machine_check)
{
+ unsigned long dr7;
+
+ dr7 = local_db_save();
exc_machine_check_kernel(regs);
+ local_db_restore(dr7);
}
/* The user mode variant. */
DEFINE_IDTENTRY_MCE_USER(exc_machine_check)
{
+ unsigned long dr7;
+
+ dr7 = local_db_save();
exc_machine_check_user(regs);
+ local_db_restore(dr7);
}
#else
/* 32bit unified entry point */
DEFINE_IDTENTRY_MCE(exc_machine_check)
{
+ unsigned long dr7;
+
+ dr7 = local_db_save();
if (user_mode(regs))
exc_machine_check_user(regs);
else
exc_machine_check_kernel(regs);
+ local_db_restore(dr7);
}
#endif
Powered by blists - more mailing lists