1 // SPDX-License-Identifier: GPL-2.0-only
3 * APEI Error INJection support
5 * EINJ provides a hardware error injection mechanism, this is useful
6 * for debugging and testing of other APEI and RAS features.
8 * For more information about EINJ, please refer to ACPI Specification
9 * version 4.0, section 17.5.
11 * Copyright 2009-2010 Intel Corp.
12 * Author: Huang Ying <ying.huang@intel.com>
15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/init.h>
19 #include <linux/debugfs.h>
20 #include <linux/seq_file.h>
21 #include <linux/nmi.h>
22 #include <linux/delay.h>
24 #include <asm/unaligned.h>
26 #include "apei-internal.h"
29 #define pr_fmt(fmt) "EINJ: " fmt
31 #define SLEEP_UNIT_MIN 1000 /* 1ms */
32 #define SLEEP_UNIT_MAX 5000 /* 5ms */
33 /* Firmware should respond within 1 seconds */
34 #define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC)
35 #define ACPI5_VENDOR_BIT BIT(31)
36 #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \
37 ACPI_EINJ_MEMORY_UNCORRECTABLE | \
38 ACPI_EINJ_MEMORY_FATAL)
41 * ACPI version 5 provides a SET_ERROR_TYPE_WITH_ADDRESS action.
45 struct set_error_type_with_address {
51 u64 memory_address_range;
55 SETWA_FLAGS_APICID = 1,
57 SETWA_FLAGS_PCIE_SBDF = 4,
61 * Vendor extensions for platform specific operations
63 struct vendor_error_type_extension {
74 static u32 vendor_flags;
75 static struct debugfs_blob_wrapper vendor_blob;
76 static struct debugfs_blob_wrapper vendor_errors;
77 static char vendor_dev[64];
80 * Some BIOSes allow parameters to the SET_ERROR_TYPE entries in the
81 * EINJ table through an unpublished extension. Use with caution as
82 * most will ignore the parameter and make their own choice of address
83 * for error injection. This extension is used only if
84 * param_extension module parameter is specified.
86 struct einj_parameter {
94 #define EINJ_OP_BUSY 0x1
95 #define EINJ_STATUS_SUCCESS 0x0
96 #define EINJ_STATUS_FAIL 0x1
97 #define EINJ_STATUS_INVAL 0x2
99 #define EINJ_TAB_ENTRY(tab) \
100 ((struct acpi_whea_header *)((char *)(tab) + \
101 sizeof(struct acpi_table_einj)))
103 static bool param_extension;
104 module_param(param_extension, bool, 0);
106 static struct acpi_table_einj *einj_tab;
108 static struct apei_resources einj_resources;
110 static struct apei_exec_ins_type einj_ins_type[] = {
111 [ACPI_EINJ_READ_REGISTER] = {
112 .flags = APEI_EXEC_INS_ACCESS_REGISTER,
113 .run = apei_exec_read_register,
115 [ACPI_EINJ_READ_REGISTER_VALUE] = {
116 .flags = APEI_EXEC_INS_ACCESS_REGISTER,
117 .run = apei_exec_read_register_value,
119 [ACPI_EINJ_WRITE_REGISTER] = {
120 .flags = APEI_EXEC_INS_ACCESS_REGISTER,
121 .run = apei_exec_write_register,
123 [ACPI_EINJ_WRITE_REGISTER_VALUE] = {
124 .flags = APEI_EXEC_INS_ACCESS_REGISTER,
125 .run = apei_exec_write_register_value,
129 .run = apei_exec_noop,
134 * Prevent EINJ interpreter to run simultaneously, because the
135 * corresponding firmware implementation may not work properly when
136 * invoked simultaneously.
138 static DEFINE_MUTEX(einj_mutex);
140 static void *einj_param;
142 static void einj_exec_ctx_init(struct apei_exec_context *ctx)
144 apei_exec_ctx_init(ctx, einj_ins_type, ARRAY_SIZE(einj_ins_type),
145 EINJ_TAB_ENTRY(einj_tab), einj_tab->entries);
148 static int __einj_get_available_error_type(u32 *type)
150 struct apei_exec_context ctx;
153 einj_exec_ctx_init(&ctx);
154 rc = apei_exec_run(&ctx, ACPI_EINJ_GET_ERROR_TYPE);
157 *type = apei_exec_ctx_get_output(&ctx);
162 /* Get error injection capabilities of the platform */
163 static int einj_get_available_error_type(u32 *type)
167 mutex_lock(&einj_mutex);
168 rc = __einj_get_available_error_type(type);
169 mutex_unlock(&einj_mutex);
174 static int einj_timedout(u64 *t)
176 if ((s64)*t < SLEEP_UNIT_MIN) {
177 pr_warn(FW_WARN "Firmware does not respond in time\n");
180 *t -= SLEEP_UNIT_MIN;
181 usleep_range(SLEEP_UNIT_MIN, SLEEP_UNIT_MAX);
186 static void get_oem_vendor_struct(u64 paddr, int offset,
187 struct vendor_error_type_extension *v)
189 unsigned long vendor_size;
190 u64 target_pa = paddr + offset + sizeof(struct vendor_error_type_extension);
192 vendor_size = v->length - sizeof(struct vendor_error_type_extension);
195 vendor_errors.data = acpi_os_map_memory(target_pa, vendor_size);
197 if (vendor_errors.data)
198 vendor_errors.size = vendor_size;
201 static void check_vendor_extension(u64 paddr,
202 struct set_error_type_with_address *v5param)
204 int offset = v5param->vendor_extension;
205 struct vendor_error_type_extension *v;
210 v = acpi_os_map_iomem(paddr + offset, sizeof(*v));
213 get_oem_vendor_struct(paddr, offset, v);
215 sprintf(vendor_dev, "%x:%x:%x.%x vendor_id=%x device_id=%x rev_id=%x\n",
216 sbdf >> 24, (sbdf >> 16) & 0xff,
217 (sbdf >> 11) & 0x1f, (sbdf >> 8) & 0x7,
218 v->vendor_id, v->device_id, v->rev_id);
219 acpi_os_unmap_iomem(v, sizeof(*v));
222 static void *einj_get_parameter_address(void)
225 u64 pa_v4 = 0, pa_v5 = 0;
226 struct acpi_whea_header *entry;
228 entry = EINJ_TAB_ENTRY(einj_tab);
229 for (i = 0; i < einj_tab->entries; i++) {
230 if (entry->action == ACPI_EINJ_SET_ERROR_TYPE &&
231 entry->instruction == ACPI_EINJ_WRITE_REGISTER &&
232 entry->register_region.space_id ==
233 ACPI_ADR_SPACE_SYSTEM_MEMORY)
234 pa_v4 = get_unaligned(&entry->register_region.address);
235 if (entry->action == ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS &&
236 entry->instruction == ACPI_EINJ_WRITE_REGISTER &&
237 entry->register_region.space_id ==
238 ACPI_ADR_SPACE_SYSTEM_MEMORY)
239 pa_v5 = get_unaligned(&entry->register_region.address);
243 struct set_error_type_with_address *v5param;
245 v5param = acpi_os_map_iomem(pa_v5, sizeof(*v5param));
248 check_vendor_extension(pa_v5, v5param);
252 if (param_extension && pa_v4) {
253 struct einj_parameter *v4param;
255 v4param = acpi_os_map_iomem(pa_v4, sizeof(*v4param));
258 if (v4param->reserved1 || v4param->reserved2) {
259 acpi_os_unmap_iomem(v4param, sizeof(*v4param));
268 /* do sanity check to trigger table */
269 static int einj_check_trigger_header(struct acpi_einj_trigger *trigger_tab)
271 if (trigger_tab->header_size != sizeof(struct acpi_einj_trigger))
273 if (trigger_tab->table_size > PAGE_SIZE ||
274 trigger_tab->table_size < trigger_tab->header_size)
276 if (trigger_tab->entry_count !=
277 (trigger_tab->table_size - trigger_tab->header_size) /
278 sizeof(struct acpi_einj_entry))
284 static struct acpi_generic_address *einj_get_trigger_parameter_region(
285 struct acpi_einj_trigger *trigger_tab, u64 param1, u64 param2)
288 struct acpi_whea_header *entry;
290 entry = (struct acpi_whea_header *)
291 ((char *)trigger_tab + sizeof(struct acpi_einj_trigger));
292 for (i = 0; i < trigger_tab->entry_count; i++) {
293 if (entry->action == ACPI_EINJ_TRIGGER_ERROR &&
294 entry->instruction <= ACPI_EINJ_WRITE_REGISTER_VALUE &&
295 entry->register_region.space_id ==
296 ACPI_ADR_SPACE_SYSTEM_MEMORY &&
297 (entry->register_region.address & param2) == (param1 & param2))
298 return &entry->register_region;
304 /* Execute instructions in trigger error action table */
305 static int __einj_error_trigger(u64 trigger_paddr, u32 type,
306 u64 param1, u64 param2)
308 struct acpi_einj_trigger *trigger_tab = NULL;
309 struct apei_exec_context trigger_ctx;
310 struct apei_resources trigger_resources;
311 struct acpi_whea_header *trigger_entry;
315 struct acpi_generic_address *trigger_param_region = NULL;
317 r = request_mem_region(trigger_paddr, sizeof(*trigger_tab),
318 "APEI EINJ Trigger Table");
320 pr_err("Can not request [mem %#010llx-%#010llx] for Trigger table\n",
321 (unsigned long long)trigger_paddr,
322 (unsigned long long)trigger_paddr +
323 sizeof(*trigger_tab) - 1);
326 trigger_tab = ioremap_cache(trigger_paddr, sizeof(*trigger_tab));
328 pr_err("Failed to map trigger table!\n");
331 rc = einj_check_trigger_header(trigger_tab);
333 pr_warn(FW_BUG "Invalid trigger error action table.\n");
337 /* No action structures in the TRIGGER_ERROR table, nothing to do */
338 if (!trigger_tab->entry_count)
342 table_size = trigger_tab->table_size;
343 r = request_mem_region(trigger_paddr + sizeof(*trigger_tab),
344 table_size - sizeof(*trigger_tab),
345 "APEI EINJ Trigger Table");
347 pr_err("Can not request [mem %#010llx-%#010llx] for Trigger Table Entry\n",
348 (unsigned long long)trigger_paddr + sizeof(*trigger_tab),
349 (unsigned long long)trigger_paddr + table_size - 1);
352 iounmap(trigger_tab);
353 trigger_tab = ioremap_cache(trigger_paddr, table_size);
355 pr_err("Failed to map trigger table!\n");
358 trigger_entry = (struct acpi_whea_header *)
359 ((char *)trigger_tab + sizeof(struct acpi_einj_trigger));
360 apei_resources_init(&trigger_resources);
361 apei_exec_ctx_init(&trigger_ctx, einj_ins_type,
362 ARRAY_SIZE(einj_ins_type),
363 trigger_entry, trigger_tab->entry_count);
364 rc = apei_exec_collect_resources(&trigger_ctx, &trigger_resources);
367 rc = apei_resources_sub(&trigger_resources, &einj_resources);
371 * Some firmware will access target address specified in
372 * param1 to trigger the error when injecting memory error.
373 * This will cause resource conflict with regular memory. So
374 * remove it from trigger table resources.
376 if ((param_extension || acpi5) && (type & MEM_ERROR_MASK) && param2) {
377 struct apei_resources addr_resources;
379 apei_resources_init(&addr_resources);
380 trigger_param_region = einj_get_trigger_parameter_region(
381 trigger_tab, param1, param2);
382 if (trigger_param_region) {
383 rc = apei_resources_add(&addr_resources,
384 trigger_param_region->address,
385 trigger_param_region->bit_width/8, true);
388 rc = apei_resources_sub(&trigger_resources,
391 apei_resources_fini(&addr_resources);
395 rc = apei_resources_request(&trigger_resources, "APEI EINJ Trigger");
398 rc = apei_exec_pre_map_gars(&trigger_ctx);
402 rc = apei_exec_run(&trigger_ctx, ACPI_EINJ_TRIGGER_ERROR);
404 apei_exec_post_unmap_gars(&trigger_ctx);
406 apei_resources_release(&trigger_resources);
408 apei_resources_fini(&trigger_resources);
410 release_mem_region(trigger_paddr + sizeof(*trigger_tab),
411 table_size - sizeof(*trigger_tab));
413 release_mem_region(trigger_paddr, sizeof(*trigger_tab));
416 iounmap(trigger_tab);
421 static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
422 u64 param3, u64 param4)
424 struct apei_exec_context ctx;
425 u64 val, trigger_paddr, timeout = FIRMWARE_TIMEOUT;
428 einj_exec_ctx_init(&ctx);
430 rc = apei_exec_run_optional(&ctx, ACPI_EINJ_BEGIN_OPERATION);
433 apei_exec_ctx_set_input(&ctx, type);
435 struct set_error_type_with_address *v5param = einj_param;
437 v5param->type = type;
438 if (type & ACPI5_VENDOR_BIT) {
439 switch (vendor_flags) {
440 case SETWA_FLAGS_APICID:
441 v5param->apicid = param1;
443 case SETWA_FLAGS_MEM:
444 v5param->memory_address = param1;
445 v5param->memory_address_range = param2;
447 case SETWA_FLAGS_PCIE_SBDF:
448 v5param->pcie_sbdf = param1;
451 v5param->flags = vendor_flags;
453 v5param->flags = flags;
454 v5param->memory_address = param1;
455 v5param->memory_address_range = param2;
456 v5param->apicid = param3;
457 v5param->pcie_sbdf = param4;
460 case ACPI_EINJ_PROCESSOR_CORRECTABLE:
461 case ACPI_EINJ_PROCESSOR_UNCORRECTABLE:
462 case ACPI_EINJ_PROCESSOR_FATAL:
463 v5param->apicid = param1;
464 v5param->flags = SETWA_FLAGS_APICID;
466 case ACPI_EINJ_MEMORY_CORRECTABLE:
467 case ACPI_EINJ_MEMORY_UNCORRECTABLE:
468 case ACPI_EINJ_MEMORY_FATAL:
469 v5param->memory_address = param1;
470 v5param->memory_address_range = param2;
471 v5param->flags = SETWA_FLAGS_MEM;
473 case ACPI_EINJ_PCIX_CORRECTABLE:
474 case ACPI_EINJ_PCIX_UNCORRECTABLE:
475 case ACPI_EINJ_PCIX_FATAL:
476 v5param->pcie_sbdf = param1;
477 v5param->flags = SETWA_FLAGS_PCIE_SBDF;
482 rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE);
486 struct einj_parameter *v4param = einj_param;
488 v4param->param1 = param1;
489 v4param->param2 = param2;
492 rc = apei_exec_run(&ctx, ACPI_EINJ_EXECUTE_OPERATION);
496 rc = apei_exec_run(&ctx, ACPI_EINJ_CHECK_BUSY_STATUS);
499 val = apei_exec_ctx_get_output(&ctx);
500 if (!(val & EINJ_OP_BUSY))
502 if (einj_timedout(&timeout))
505 rc = apei_exec_run(&ctx, ACPI_EINJ_GET_COMMAND_STATUS);
508 val = apei_exec_ctx_get_output(&ctx);
509 if (val == EINJ_STATUS_FAIL)
511 else if (val == EINJ_STATUS_INVAL)
515 * The error is injected into the platform successfully, then it needs
516 * to trigger the error.
518 rc = apei_exec_run(&ctx, ACPI_EINJ_GET_TRIGGER_TABLE);
521 trigger_paddr = apei_exec_ctx_get_output(&ctx);
522 if (notrigger == 0) {
523 rc = __einj_error_trigger(trigger_paddr, type, param1, param2);
527 rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION);
532 /* Inject the specified hardware error */
533 static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
534 u64 param3, u64 param4)
539 /* If user manually set "flags", make sure it is legal */
540 if (flags && (flags &
541 ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF)))
545 * We need extra sanity checks for memory errors.
546 * Other types leap directly to injection.
549 /* ensure param1/param2 existed */
550 if (!(param_extension || acpi5))
553 /* ensure injection is memory related */
554 if (type & ACPI5_VENDOR_BIT) {
555 if (vendor_flags != SETWA_FLAGS_MEM)
557 } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM))
561 * Disallow crazy address masks that give BIOS leeway to pick
562 * injection address almost anywhere. Insist on page or
563 * better granularity and that target address is normal RAM or
566 base_addr = param1 & param2;
569 if (((param2 & PAGE_MASK) != PAGE_MASK) ||
570 ((region_intersects(base_addr, size, IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE)
571 != REGION_INTERSECTS) &&
572 (region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_PERSISTENT_MEMORY)
573 != REGION_INTERSECTS) &&
574 (region_intersects(base_addr, size, IORESOURCE_MEM, IORES_DESC_SOFT_RESERVED)
575 != REGION_INTERSECTS) &&
576 !arch_is_platform_page(base_addr)))
579 if (is_zero_pfn(base_addr >> PAGE_SHIFT))
583 mutex_lock(&einj_mutex);
584 rc = __einj_error_inject(type, flags, param1, param2, param3, param4);
585 mutex_unlock(&einj_mutex);
590 static u32 error_type;
591 static u32 error_flags;
592 static u64 error_param1;
593 static u64 error_param2;
594 static u64 error_param3;
595 static u64 error_param4;
596 static struct dentry *einj_debug_dir;
597 static struct { u32 mask; const char *str; } const einj_error_type_string[] = {
598 { BIT(0), "Processor Correctable" },
599 { BIT(1), "Processor Uncorrectable non-fatal" },
600 { BIT(2), "Processor Uncorrectable fatal" },
601 { BIT(3), "Memory Correctable" },
602 { BIT(4), "Memory Uncorrectable non-fatal" },
603 { BIT(5), "Memory Uncorrectable fatal" },
604 { BIT(6), "PCI Express Correctable" },
605 { BIT(7), "PCI Express Uncorrectable non-fatal" },
606 { BIT(8), "PCI Express Uncorrectable fatal" },
607 { BIT(9), "Platform Correctable" },
608 { BIT(10), "Platform Uncorrectable non-fatal" },
609 { BIT(11), "Platform Uncorrectable fatal"},
610 { BIT(12), "CXL.cache Protocol Correctable" },
611 { BIT(13), "CXL.cache Protocol Uncorrectable non-fatal" },
612 { BIT(14), "CXL.cache Protocol Uncorrectable fatal" },
613 { BIT(15), "CXL.mem Protocol Correctable" },
614 { BIT(16), "CXL.mem Protocol Uncorrectable non-fatal" },
615 { BIT(17), "CXL.mem Protocol Uncorrectable fatal" },
616 { BIT(31), "Vendor Defined Error Types" },
619 static int available_error_type_show(struct seq_file *m, void *v)
624 rc = einj_get_available_error_type(&error_type);
627 for (int pos = 0; pos < ARRAY_SIZE(einj_error_type_string); pos++)
628 if (error_type & einj_error_type_string[pos].mask)
629 seq_printf(m, "0x%08x\t%s\n", einj_error_type_string[pos].mask,
630 einj_error_type_string[pos].str);
635 DEFINE_SHOW_ATTRIBUTE(available_error_type);
637 static int error_type_get(void *data, u64 *val)
644 static int error_type_set(void *data, u64 val)
647 u32 available_error_type = 0;
650 /* Only low 32 bits for error type are valid */
651 if (val & GENMASK_ULL(63, 32))
655 * Vendor defined types have 0x80000000 bit set, and
656 * are not enumerated by ACPI_EINJ_GET_ERROR_TYPE
658 vendor = val & ACPI5_VENDOR_BIT;
659 tval = val & 0x7fffffff;
661 /* Only one error type can be specified */
662 if (tval & (tval - 1))
665 rc = einj_get_available_error_type(&available_error_type);
668 if (!(val & available_error_type))
676 DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set,
679 static int error_inject_set(void *data, u64 val)
684 return einj_error_inject(error_type, error_flags, error_param1, error_param2,
685 error_param3, error_param4);
688 DEFINE_DEBUGFS_ATTRIBUTE(error_inject_fops, NULL, error_inject_set, "%llu\n");
690 static int einj_check_table(struct acpi_table_einj *einj_tab)
692 if ((einj_tab->header_length !=
693 (sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))
694 && (einj_tab->header_length != sizeof(struct acpi_table_einj)))
696 if (einj_tab->header.length < sizeof(struct acpi_table_einj))
698 if (einj_tab->entries !=
699 (einj_tab->header.length - sizeof(struct acpi_table_einj)) /
700 sizeof(struct acpi_einj_entry))
706 static int __init einj_init(void)
710 struct apei_exec_context ctx;
713 pr_info("ACPI disabled.\n");
717 status = acpi_get_table(ACPI_SIG_EINJ, 0,
718 (struct acpi_table_header **)&einj_tab);
719 if (status == AE_NOT_FOUND) {
720 pr_warn("EINJ table not found.\n");
722 } else if (ACPI_FAILURE(status)) {
723 pr_err("Failed to get EINJ table: %s\n",
724 acpi_format_exception(status));
728 rc = einj_check_table(einj_tab);
730 pr_warn(FW_BUG "Invalid EINJ table.\n");
735 einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
737 debugfs_create_file("available_error_type", S_IRUSR, einj_debug_dir,
738 NULL, &available_error_type_fops);
739 debugfs_create_file_unsafe("error_type", 0600, einj_debug_dir,
740 NULL, &error_type_fops);
741 debugfs_create_file_unsafe("error_inject", 0200, einj_debug_dir,
742 NULL, &error_inject_fops);
744 apei_resources_init(&einj_resources);
745 einj_exec_ctx_init(&ctx);
746 rc = apei_exec_collect_resources(&ctx, &einj_resources);
748 pr_err("Error collecting EINJ resources.\n");
752 rc = apei_resources_request(&einj_resources, "APEI EINJ");
754 pr_err("Error requesting memory/port resources.\n");
758 rc = apei_exec_pre_map_gars(&ctx);
760 pr_err("Error pre-mapping GARs.\n");
764 einj_param = einj_get_parameter_address();
765 if ((param_extension || acpi5) && einj_param) {
766 debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
768 debugfs_create_x64("param1", S_IRUSR | S_IWUSR, einj_debug_dir,
770 debugfs_create_x64("param2", S_IRUSR | S_IWUSR, einj_debug_dir,
772 debugfs_create_x64("param3", S_IRUSR | S_IWUSR, einj_debug_dir,
774 debugfs_create_x64("param4", S_IRUSR | S_IWUSR, einj_debug_dir,
776 debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR,
777 einj_debug_dir, ¬rigger);
781 vendor_blob.data = vendor_dev;
782 vendor_blob.size = strlen(vendor_dev);
783 debugfs_create_blob("vendor", S_IRUSR, einj_debug_dir,
785 debugfs_create_x32("vendor_flags", S_IRUSR | S_IWUSR,
786 einj_debug_dir, &vendor_flags);
789 if (vendor_errors.size)
790 debugfs_create_blob("oem_error", 0600, einj_debug_dir,
793 pr_info("Error INJection is initialized.\n");
798 apei_resources_release(&einj_resources);
800 apei_resources_fini(&einj_resources);
801 debugfs_remove_recursive(einj_debug_dir);
803 acpi_put_table((struct acpi_table_header *)einj_tab);
808 static void __exit einj_exit(void)
810 struct apei_exec_context ctx;
813 acpi_size size = (acpi5) ?
814 sizeof(struct set_error_type_with_address) :
815 sizeof(struct einj_parameter);
817 acpi_os_unmap_iomem(einj_param, size);
818 if (vendor_errors.size)
819 acpi_os_unmap_memory(vendor_errors.data, vendor_errors.size);
821 einj_exec_ctx_init(&ctx);
822 apei_exec_post_unmap_gars(&ctx);
823 apei_resources_release(&einj_resources);
824 apei_resources_fini(&einj_resources);
825 debugfs_remove_recursive(einj_debug_dir);
826 acpi_put_table((struct acpi_table_header *)einj_tab);
829 module_init(einj_init);
830 module_exit(einj_exit);
832 MODULE_AUTHOR("Huang Ying");
833 MODULE_DESCRIPTION("APEI Error INJection support");
834 MODULE_LICENSE("GPL");