/* * Copyright (C) 2006, Intel Corporation * * This file is part of the Linux-ready Firmware Developer Kit * * This program file is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published by the * Free Software Foundation;version 2.1 of the License. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program in a file named COPYING; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA */ #include #include #include #include #include #include "../biostest.h" static void process_version(char *line) { char *version; char summary[1024]; version = strstr(line,"sion "); if (!version) return; version+=5; sprintf(summary, "Linux ACPI interpreter has version %s", version); report_result("acpiinfo", INFO, summary, line, NULL); } static void process_compiler(char *line) { char vendor[1024]; char summary[1024]; strcpy(vendor,"Unknown"); if (strstr(line,"MSFT")) strcpy(vendor,"Microsoft"); if (strstr(line,"INTL")) strcpy(vendor,"Intel"); sprintf(summary,"DSDT was compiled by the %s AML compiler", vendor); report_result("acpiinfo", INFO, summary, line, NULL); } extern char *current_test; static void check_line(gpointer data, gpointer user_data) { static char *prevline = NULL; char *line = (char *)data; if (strstr(line, "ACPI: Subsystem revision")!=NULL) process_version(line); if (strstr(line, "ACPI: DSDT")!=NULL) process_compiler(line); if (strstr(line, "Disabling IRQ")!=NULL && prevline && strstr(prevline,"acpi_irq")) report_result("acpiinfo", FAIL, "ACPI interrupt got stuck: level triggered?", NULL, "dmesg://"); if (prevline && strstr(prevline, "*** Error: Return object type is incorrect")) { char buf[8192]; sprintf(buf, "Return object type is incorrect: %s \n", line); report_result("acpiinfo", FAIL, buf, line, NULL); } if (strstr(line,"ACPI: acpi_ec_space_handler: bit_width is 32, should be")) report_result("acpiinfo", FAIL, "Embedded controller bit_width is incorrect", line, "dmesg://"); if (strstr(line,"acpi_ec_space_handler: bit_width should be")) report_result("acpiinfo", FAIL, "Embedded controller bit_width is incorrect", line, "dmesg://"); if (strstr(line,"Warning: acpi_table_parse(ACPI_SRAT) returned 0!")) report_result("acpiinfo", FAIL, "SRAT table cannot be found", line, "dmesg://"); if (strstr(line,"Warning: acpi_table_parse(ACPI_SLIT) returned 0!")) report_result("acpiinfo", FAIL, "SLIT table cannot be found", line, "dmesg://"); if (strstr(line, "WARNING: No sibling found for CPU")) report_result("acpiinfo", FAIL, "Hyperthreading CPU enumeration fails", line, "dmesg://"); if (prevline && strstr(line, ">>> ERROR: Invalid checksum") && strlen(prevline)>11) { char line2[4096]; char buf[4096]; strcpy(line2, prevline); line2[11]=0; sprintf(buf, "ACPI table %s has an invalid checksum", &line2[6]); report_result("acpiinfo", FAIL, buf, prevline, "dmesg://"); } if (strstr(line, "MP-BIOS bug: 8254 timer not connected to IO-APIC")) report_result("acpiinfo", FAIL, line, prevline, "dmesg://"); if (strstr(line, "ACPI: PCI Interrupt Link") && strstr(line, " disabled and referenced, BIOS bug.")) report_result("acpiinfo", FAIL, line, prevline, "dmesg://"); if (strstr(line, "*** Warning Inconsistent FADT length") && strstr(line, "using FADT V1.0 portion of table")) report_result("acpiinfo", FAIL, "FADT table claims to be of higher revision than it is", line, "dmesg://"); if (strstr(line, "thermal_get_trip_point: Invalid active threshold")) report_result("acpiinfo", FAIL, "_AC0 thermal trip point is invalid", line, "dmesg://"); if (strstr(line, "MMCONFIG has no entries")) report_result("acpiinfo", FAIL, "The MCFG table has no entries!", line, "dmesg://"); if (strstr(line, "MMCONFIG not in low 4GB of memory")) report_result("acpiinfo", FAIL, "The MCFG table entries are not in the lower 4Gb of ram", line, "dmesg://"); if (strstr(line, "pcie_portdrv_probe->Dev") && strstr(line, "has invalid IRQ. Check vendor BIOS")) report_result("acpiinfo", FAIL, "PCI Express port driver reports an invalid IRQ", line, "dmesg://"); if (strstr(line, "BIOS handoff failed (BIOS bug ?)")) report_result("acpiinfo", FAIL, "EHCI BIOS emulation handoff failed", line, "dmesg://"); /* and do the generic ones as well */ dmesg_common_errors(line,"dmesg://"); free(prevline); prevline = strdup(line); } void run_test(void) { start_test("acpiinfo", "General ACPI information", "This test checks the output of the in-kernel ACPI CA against common " "error messages that indicate a bad interaction with the bios, including " "those that point at AML syntax errors."); g_list_foreach(boot_dmesg, check_line, NULL); finish_test("acpiinfo"); }