diff options
author | Lin Ming <ming.m.lin@intel.com> | 2010-03-31 22:47:56 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-04-20 10:43:16 -0400 |
commit | 729df0f848daf2f17d02107199fa92efe909d995 (patch) | |
tree | d4ece34a277019368999fd36a0bf15a39eeaa742 /drivers/acpi/acpica/tbutils.c | |
parent | c1637e9c649a0eb72c467041d78275aabdd48a41 (diff) |
ACPICA: Add detection of corrupted/replaced DSDT
This change adds support to detect a DSDT that has been corrupted
and/or replaced from outside the OS (by firmware). This is
typically catastrophic for the system, but has been seen on
some machines.
https://bugzilla.kernel.org/show_bug.cgi?id=14679
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/tbutils.c')
-rw-r--r-- | drivers/acpi/acpica/tbutils.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c index f47a70e20063..07bc7437f82b 100644 --- a/drivers/acpi/acpica/tbutils.c +++ b/drivers/acpi/acpica/tbutils.c | |||
@@ -349,6 +349,44 @@ u8 acpi_tb_checksum(u8 *buffer, u32 length) | |||
349 | 349 | ||
350 | /******************************************************************************* | 350 | /******************************************************************************* |
351 | * | 351 | * |
352 | * FUNCTION: acpi_tb_check_dsdt_header | ||
353 | * | ||
354 | * PARAMETERS: None | ||
355 | * | ||
356 | * RETURN: None | ||
357 | * | ||
358 | * DESCRIPTION: Quick compare to check validity of the DSDT. This will detect | ||
359 | * if the DSDT has been replaced from outside the OS and/or if | ||
360 | * the DSDT header has been corrupted. | ||
361 | * | ||
362 | ******************************************************************************/ | ||
363 | |||
364 | void acpi_tb_check_dsdt_header(void) | ||
365 | { | ||
366 | |||
367 | /* Compare original length and checksum to current values */ | ||
368 | |||
369 | if (acpi_gbl_original_dsdt_header.length != | ||
370 | acpi_gbl_DSDT->pointer->length | ||
371 | || acpi_gbl_original_dsdt_header.checksum != | ||
372 | acpi_gbl_DSDT->pointer->checksum) { | ||
373 | ACPI_ERROR((AE_INFO, | ||
374 | "The DSDT has been corrupted or replaced - old, new headers below")); | ||
375 | acpi_tb_print_table_header(0, &acpi_gbl_original_dsdt_header); | ||
376 | acpi_tb_print_table_header(acpi_gbl_DSDT->address, | ||
377 | acpi_gbl_DSDT->pointer); | ||
378 | |||
379 | /* Disable further error messages */ | ||
380 | |||
381 | acpi_gbl_original_dsdt_header.length = | ||
382 | acpi_gbl_DSDT->pointer->length; | ||
383 | acpi_gbl_original_dsdt_header.checksum = | ||
384 | acpi_gbl_DSDT->pointer->checksum; | ||
385 | } | ||
386 | } | ||
387 | |||
388 | /******************************************************************************* | ||
389 | * | ||
352 | * FUNCTION: acpi_tb_install_table | 390 | * FUNCTION: acpi_tb_install_table |
353 | * | 391 | * |
354 | * PARAMETERS: Address - Physical address of DSDT or FACS | 392 | * PARAMETERS: Address - Physical address of DSDT or FACS |