1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 在 drivers/acpi/apei/ghes.c 中: static int __devinit ghes_probe(struct platform_device *ghes_dev) { …… switch (generic->notify.type) { …… case ACPI_HEST_NOTIFY_SCI: mutex_lock(&ghes_list_mutex); if (list_empty(&ghes_sci)) register_acpi_hed_notifier(&ghes_notifier_sci); list_add_rcu(&ghes->list, &ghes_sci); mutex_unlock(&ghes_list_mutex); break; case ACPI_HEST_NOTIFY_NMI: len = ghes_esource_prealloc_size(generic); ghes_estatus_pool_expand(len); mutex_lock(&ghes_list_mutex); if (list_empty(&ghes_nmi)) register_nmi_handler(NMI_LOCAL, ghes_notify_nmi, 0, "ghes"); list_add_rcu(&ghes->list, &ghes_nmi); mutex_unlock(&ghes_list_mutex); break; …… } …… } |
1 2 3 4 5 6 7 8 9 10 | 在 drivers/acpi/hed.c 中 /* * SCI to report hardware error is forwarded to the listeners of HED, * it is used by HEST Generic Hardware Error Source with notify type * SCI. */ static void acpi_hed_notify(struct acpi_device *device, u32 event) { blocking_notifier_call_chain(&acpi_hed_notify_list, 0, NULL); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 在 arch/x86/kernel/nmi.c 中 static notrace __kprobes void default_do_nmi(struct pt_regs *regs) { unsigned char reason = 0; int handled; bool b2b = false; /* * CPU-specific NMI must be processed before non-CPU-specific * NMI, otherwise we may lose it, because the CPU-specific * NMI can not be detected/processed on other CPUs. */ …… …… handled = nmi_handle(NMI_LOCAL, regs, b2b); …… } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 在 arch/x86/kernel/nmi.c 中 static int notrace __kprobes nmi_handle(unsigned int type, struct pt_regs *regs, bool b2b) { struct nmi_desc *desc = nmi_to_desc(type); struct nmiaction *a; int handled=0; rcu_read_lock(); /* * NMIs are edge-triggered, which means if you have enough * of them concurrently, you can lose some because only one * can be latched at any given time. Walk the whole list * to handle those situations. */ list_for_each_entry_rcu(a, &desc->head, list) handled += a->handler(type, regs); rcu_read_unlock(); /* return total number of NMI events handled */ return handled; } |
1 | 下表是一个通过 acpidump/acpixtract/iasl 实际解析出来的 HEST 表。 |
欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) | Powered by Discuz! 7.0.0 |