提交 66b0580b 编写于 作者: S Sumit Garg 提交者: Ruan Jinjie

kgdb: Expose default CPUs roundup fallback mechanism

maillist inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I7R4EN
CVE: NA
Reference: https://www.spinics.net/lists/arm-kernel/msg851005.html

-------------------------------------------------

Add a new API kgdb_smp_call_nmi_hook() to expose default CPUs roundup
mechanism to a particular archichecture as a runtime fallback if it
detects to not support NMI roundup.

Currently such an architecture example is arm64 supporting pseudo NMIs
feature which is only available on platforms which have support for GICv3
or later version.
Signed-off-by: NSumit Garg <sumit.garg@linaro.org>
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: NRuan Jinjie <ruanjinjie@huawei.com>
上级 868092cb
......@@ -199,6 +199,18 @@ kgdb_arch_handle_qxfer_pkt(char *remcom_in_buffer,
extern void kgdb_call_nmi_hook(void *ignored);
/**
* kgdb_smp_call_nmi_hook - Provide default fallback mechanism to
* round-up CPUs
*
* If you're using the default implementation of kgdb_roundup_cpus()
* this function will be called. And if an arch detects at runtime to
* not support NMI based roundup then it can fallback to default
* mechanism using this API.
*/
extern void kgdb_smp_call_nmi_hook(void);
/**
* kgdb_roundup_cpus - Get other CPUs into a holding pattern
*
......
......@@ -238,7 +238,7 @@ NOKPROBE_SYMBOL(kgdb_call_nmi_hook);
static DEFINE_PER_CPU(call_single_data_t, kgdb_roundup_csd) =
CSD_INIT(kgdb_call_nmi_hook, NULL);
void __weak kgdb_roundup_cpus(void)
void kgdb_smp_call_nmi_hook(void)
{
call_single_data_t *csd;
int this_cpu = raw_smp_processor_id();
......@@ -269,6 +269,12 @@ void __weak kgdb_roundup_cpus(void)
kgdb_info[cpu].rounding_up = false;
}
}
NOKPROBE_SYMBOL(kgdb_smp_call_nmi_hook);
void __weak kgdb_roundup_cpus(void)
{
kgdb_smp_call_nmi_hook();
}
NOKPROBE_SYMBOL(kgdb_roundup_cpus);
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册