Commit 023e2ee1 authored by Lv Zheng's avatar Lv Zheng Committed by Rafael J. Wysocki
Browse files

ACPICA: Tables: Change table duplication check to be related to acpi_gbl_verify_table_checksum

ACPICA commit 3d837b5d4b1033942b4d91c7d3801a09c3157918

acpi_gbl_verify_table_checksum is used to avoid validating (mapping) an entire
table in OS boot stage. 2nd "Reload" check in acpi_tb_install_standard_table()
is prepared for the same purpose. So this patch combines them together
using a renamed acpi_gbl_enable_table_validation flag. Lv Zheng.

Link: https://github.com/acpica/acpica/commit/3d837b5d


Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 04ba15aa
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -338,7 +338,7 @@ void acpi_tb_invalidate_table(struct acpi_table_desc *table_desc)
acpi_status acpi_tb_validate_temp_table(struct acpi_table_desc *table_desc)
{

	if (!table_desc->pointer && !acpi_gbl_verify_table_checksum) {
	if (!table_desc->pointer && !acpi_gbl_enable_table_validation) {
		/*
		 * Only validates the header of the table.
		 * Note that Length contains the size of the mapping after invoking
@@ -394,7 +394,7 @@ acpi_tb_verify_temp_table(struct acpi_table_desc *table_desc, char *signature)

	/* Verify the checksum */

	if (acpi_gbl_verify_table_checksum) {
	if (acpi_gbl_enable_table_validation) {
		status =
		    acpi_tb_verify_checksum(table_desc->pointer,
					    table_desc->length);
+1 −1
Original line number Diff line number Diff line
@@ -221,7 +221,7 @@ acpi_tb_install_standard_table(acpi_physical_address address,

	(void)acpi_ut_acquire_mutex(ACPI_MTX_TABLES);

	if (reload) {
	if (acpi_gbl_enable_table_validation) {

		/* Check if table is already registered */

+8 −0
Original line number Diff line number Diff line
@@ -194,6 +194,14 @@ acpi_status ACPI_INIT_FUNCTION acpi_reallocate_root_table(void)
		}
	}

	if (!acpi_gbl_enable_table_validation) {
		/*
		 * Now it's safe to do full table validation. We can do deferred
		 * table initilization here once the flag is set.
		 */
		acpi_gbl_enable_table_validation = TRUE;
	}

	acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE;

	status = acpi_tb_resize_root_table_list();
+0 −3
Original line number Diff line number Diff line
@@ -995,9 +995,6 @@ void __init acpi_early_init(void)

	printk(KERN_INFO PREFIX "Core revision %08x\n", ACPI_CA_VERSION);

	/* It's safe to verify table checksums during late stage */
	acpi_gbl_verify_table_checksum = TRUE;

	/* enable workarounds, unless strict ACPI spec. compliance */
	if (!acpi_strict)
		acpi_gbl_enable_interpreter_slack = TRUE;
+2 −2
Original line number Diff line number Diff line
@@ -740,10 +740,10 @@ int __init acpi_table_init(void)

	if (acpi_verify_table_checksum) {
		pr_info("Early table checksum verification enabled\n");
		acpi_gbl_verify_table_checksum = TRUE;
		acpi_gbl_enable_table_validation = TRUE;
	} else {
		pr_info("Early table checksum verification disabled\n");
		acpi_gbl_verify_table_checksum = FALSE;
		acpi_gbl_enable_table_validation = FALSE;
	}

	status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
Loading