Commit 64b3db22 authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Remove use of unreliable FADT revision field

The revision number in the FADT has been found to be completely
unreliable and cannot be trusted. Only the table length can be
used to infer the actual version.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 6dfad339
...@@ -384,8 +384,11 @@ static void acpi_tb_convert_fadt(void) ...@@ -384,8 +384,11 @@ static void acpi_tb_convert_fadt(void)
* *
* The ACPI 1.0 reserved fields that will be zeroed are the bytes located at * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at
* offset 45, 55, 95, and the word located at offset 109, 110. * offset 45, 55, 95, and the word located at offset 109, 110.
*
* Note: The FADT revision value is unreliable. Only the length can be
* trusted.
*/ */
if (acpi_gbl_FADT.header.revision < FADT2_REVISION_ID) { if (acpi_gbl_FADT.header.length <= ACPI_FADT_V2_SIZE) {
acpi_gbl_FADT.preferred_profile = 0; acpi_gbl_FADT.preferred_profile = 0;
acpi_gbl_FADT.pstate_control = 0; acpi_gbl_FADT.pstate_control = 0;
acpi_gbl_FADT.cst_control = 0; acpi_gbl_FADT.cst_control = 0;
......
...@@ -343,4 +343,20 @@ struct acpi_table_desc { ...@@ -343,4 +343,20 @@ struct acpi_table_desc {
#include <acpi/actbl1.h> #include <acpi/actbl1.h>
#include <acpi/actbl2.h> #include <acpi/actbl2.h>
/*
* Sizes of the various flavors of FADT. We need to look closely
* at the FADT length because the version number essentially tells
* us nothing because of many BIOS bugs where the version does not
* match the expected length. In other words, the length of the
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
* FADT V1 size: 0x74
* FADT V2 size: 0x84
* FADT V3+ size: 0xF4
*/
#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3)
#define ACPI_FADT_V3_SIZE (u32) (sizeof (struct acpi_table_fadt))
#endif /* __ACTBL_H__ */ #endif /* __ACTBL_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment