Skip to content
Permalink
Browse files
x86/split_lock: only trigger #AC panic on supported devices
split_lock_detect is only available when CONFIG_CPU_SUP_INTEL is
enabled. This fix a cross compile error.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Lili Li <lili.li@intel.com>
  • Loading branch information
lilili-kernel authored and yifanli-intel committed Aug 19, 2020
1 parent 63ba453 commit 0053f7e40ef7bcdcde0f369a711d6ab86f0fb95b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
@@ -173,6 +173,8 @@ enum x86_pf_error_code {
X86_PF_PK = 1 << 5,
};

#ifdef CONFIG_CPU_SUP_INTEL
extern bool split_lock_detect_enabled;
#endif

#endif /* _ASM_X86_TRAPS_H */
@@ -306,8 +306,10 @@ dotraplinkage void do_alignment_check(struct pt_regs *regs, long error_code)
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) == NOTIFY_STOP)
return;

#ifdef CONFIG_CPU_SUP_INTEL
if (!user_mode(regs) && split_lock_detect_enabled)
panic("Split lock detected\n");
#endif

cond_local_irq_enable(regs);

0 comments on commit 0053f7e

Please sign in to comment.