mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-13 11:17:31 +07:00
x86/entry, mce: Disallow #DB during #MC
#MC is fragile as heck, don't tempt fate. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lkml.kernel.org/r/20200529213321.131187767@infradead.org
This commit is contained in:
parent
fd338e3564
commit
cd840e424f
@ -1943,22 +1943,34 @@ static __always_inline void exc_machine_check_user(struct pt_regs *regs)
|
|||||||
/* MCE hit kernel mode */
|
/* MCE hit kernel mode */
|
||||||
DEFINE_IDTENTRY_MCE(exc_machine_check)
|
DEFINE_IDTENTRY_MCE(exc_machine_check)
|
||||||
{
|
{
|
||||||
|
unsigned long dr7;
|
||||||
|
|
||||||
|
dr7 = local_db_save();
|
||||||
exc_machine_check_kernel(regs);
|
exc_machine_check_kernel(regs);
|
||||||
|
local_db_restore(dr7);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The user mode variant. */
|
/* The user mode variant. */
|
||||||
DEFINE_IDTENTRY_MCE_USER(exc_machine_check)
|
DEFINE_IDTENTRY_MCE_USER(exc_machine_check)
|
||||||
{
|
{
|
||||||
|
unsigned long dr7;
|
||||||
|
|
||||||
|
dr7 = local_db_save();
|
||||||
exc_machine_check_user(regs);
|
exc_machine_check_user(regs);
|
||||||
|
local_db_restore(dr7);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* 32bit unified entry point */
|
/* 32bit unified entry point */
|
||||||
DEFINE_IDTENTRY_MCE(exc_machine_check)
|
DEFINE_IDTENTRY_MCE(exc_machine_check)
|
||||||
{
|
{
|
||||||
|
unsigned long dr7;
|
||||||
|
|
||||||
|
dr7 = local_db_save();
|
||||||
if (user_mode(regs))
|
if (user_mode(regs))
|
||||||
exc_machine_check_user(regs);
|
exc_machine_check_user(regs);
|
||||||
else
|
else
|
||||||
exc_machine_check_kernel(regs);
|
exc_machine_check_kernel(regs);
|
||||||
|
local_db_restore(dr7);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user