traps.c (fb610f2a2006322bebeb30408fefce6a01df09ea) traps.c (453b7740ebfda2d84be7fb583c54f0c91c592869)
1/*
2 * Based on arch/arm/kernel/traps.c
3 *
4 * Copyright (C) 1995-2009 Russell King
5 * Copyright (C) 2012 ARM Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 1010 unchanged lines hidden (view full) ---

1019/*
1020 * Initial handler for AArch64 BRK exceptions
1021 * This handler only used until debug_traps_init().
1022 */
1023int __init early_brk64(unsigned long addr, unsigned int esr,
1024 struct pt_regs *regs)
1025{
1026#ifdef CONFIG_KASAN_SW_TAGS
1/*
2 * Based on arch/arm/kernel/traps.c
3 *
4 * Copyright (C) 1995-2009 Russell King
5 * Copyright (C) 2012 ARM Ltd.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 1010 unchanged lines hidden (view full) ---

1019/*
1020 * Initial handler for AArch64 BRK exceptions
1021 * This handler only used until debug_traps_init().
1022 */
1023int __init early_brk64(unsigned long addr, unsigned int esr,
1024 struct pt_regs *regs)
1025{
1026#ifdef CONFIG_KASAN_SW_TAGS
1027 unsigned int comment = esr & BRK64_ESR_MASK;
1027 unsigned int comment = esr & ESR_ELx_BRK64_ISS_COMMENT_MASK;
1028
1029 if ((comment & ~KASAN_BRK_MASK) == KASAN_BRK_IMM)
1030 return kasan_handler(regs, esr) != DBG_HOOK_HANDLED;
1031#endif
1032 return bug_handler(regs, esr) != DBG_HOOK_HANDLED;
1033}
1034
1035/* This registration must happen early, before debug_traps_init(). */
1036void __init trap_init(void)
1037{
1038 register_kernel_break_hook(&bug_break_hook);
1039#ifdef CONFIG_KASAN_SW_TAGS
1040 register_kernel_break_hook(&kasan_break_hook);
1041#endif
1042}
1028
1029 if ((comment & ~KASAN_BRK_MASK) == KASAN_BRK_IMM)
1030 return kasan_handler(regs, esr) != DBG_HOOK_HANDLED;
1031#endif
1032 return bug_handler(regs, esr) != DBG_HOOK_HANDLED;
1033}
1034
1035/* This registration must happen early, before debug_traps_init(). */
1036void __init trap_init(void)
1037{
1038 register_kernel_break_hook(&bug_break_hook);
1039#ifdef CONFIG_KASAN_SW_TAGS
1040 register_kernel_break_hook(&kasan_break_hook);
1041#endif
1042}