// SPDX-License-Identifier: GPL-2.0-or-later /* Rewritten by Rusty Russell, on the backs of many others... Copyright(C)2001RustyRussell,2002RustyRussellIBM.
/* Given an address, look for it in the kernel exception table */ const struct exception_table_entry *search_kernel_exception_table(unsignedlong addr)
{ return search_extable(__start___ex_table,
__stop___ex_table - __start___ex_table, addr);
}
/* Given an address, look for it in the exception tables. */ conststruct exception_table_entry *search_exception_tables(unsignedlong addr)
{ conststruct exception_table_entry *e;
e = search_kernel_exception_table(addr); if (!e)
e = search_module_extables(addr); if (!e)
e = search_bpf_extables(addr); return e;
}
int notrace core_kernel_text(unsignedlong addr)
{ if (is_kernel_text(addr)) return1;
if (system_state < SYSTEM_FREEING_INITMEM &&
is_kernel_inittext(addr)) return1; return0;
}
int __kernel_text_address(unsignedlong addr)
{ if (kernel_text_address(addr)) return1; /* *Theremightbeinitsymbolsinsavedstacktraces. *Givethosesymbolsachancetobeprintedin *backtraces(suchaslockdeptraces). * *Sinceweareafterthemodule-symbolscheck,there's *nodangerofaddressoverlap:
*/ if (is_kernel_inittext(addr)) return1; return0;
}
int kernel_text_address(unsignedlong addr)
{ bool no_rcu; int ret = 1;
/* Treat this like an NMI as it can happen anywhere */ if (no_rcu)
ct_nmi_enter();
if (is_module_text_address(addr)) goto out; if (is_ftrace_trampoline(addr)) goto out; if (is_kprobe_optinsn_slot(addr) || is_kprobe_insn_slot(addr)) goto out; if (is_bpf_text_address(addr)) goto out;
ret = 0;
out: if (no_rcu)
ct_nmi_exit();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.