lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 28 Feb 2014 18:23:59 +0100
From:	Thomas Renninger <trenn@...e.de>
To:	robert.moore@...el.com, lv.zheng@...el.com, david.e.box@...el.com,
	rafael.j.wysocki@...el.com
Cc:	Thomas Renninger <trenn@...e.de>, hpa@...or.com,
	tglx@...utronix.de, ck@...rad-kostecki.de,
	linux-kernel@...r.kernel.org, x86@...nel.org, mingo@...hat.com,
	rjw@...ysocki.net, devel@...ica.org
Subject: [PATCH 2/4] ACPICA: Introduce new acpi_os_physical_table_add OS callback

This one allows OS to add arbitrary ACPI tables.

ToDo: It should get checked whether a table with the same signature already
exists and if this is the case, adding should not happen.

Signed-off-by: Thomas Renninger <trenn@...e.de>
CC: hpa@...or.com
CC: tglx@...utronix.de
CC: ck@...rad-kostecki.de
CC: linux-kernel@...r.kernel.org
CC: x86@...nel.org
CC: mingo@...hat.com
CC: rjw@...ysocki.net
CC: devel@...ica.org
---
 drivers/acpi/acpica/tbutils.c |   36 ++++++++++++++++++++++++++++++++++++
 include/acpi/acpiosxf.h       |    6 ++++++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 6412d3c..a819d198 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -453,6 +453,8 @@ static acpi_status acpi_tb_validate_xsdt(acpi_physical_address xsdt_address)
  *
  ******************************************************************************/
 
+#define ACPI_MAX_TABLE_ADD 64
+
 acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
 {
 	struct acpi_table_rsdp *rsdp;
@@ -623,5 +625,39 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
 		}
 	}
 
+	/*
+	 * ACPI Table Add:
+	 * Allow the OS to add additional tables to the global root table list
+	 */
+	for (i = 0; i < ACPI_MAX_TABLE_ADD; i++) {
+		int tmp, k;
+		table_entry_size = 0;
+		address = 0;
+		status = acpi_os_physical_table_add(&address,
+						    &table_entry_size);
+		if (status == AE_OK && table_entry_size && address) {
+			table = acpi_os_map_memory(address, table_entry_size);
+			for (k = 2; k < acpi_gbl_root_table_list.current_table_count; k++) {
+				/*
+				  Always add SSDTs. Only allow adding of other
+				  tables if none of such a signature already
+				  exists. Use the override interface instead
+				  in such a case.
+				*/
+				if (ACPI_COMPARE_NAME("SSDT", table->signature) &&
+				    !ACPI_COMPARE_NAME(&acpi_gbl_root_table_list.tables[i].signature, table->signature)) {
+	ACPI_INFO((AE_INFO, "OS table not added, signature already exists:"));
+	acpi_tb_print_table_header(address, table);
+	acpi_os_unmap_memory(table, table_entry_size);
+				} else {
+	ACPI_INFO((AE_INFO, "Add OS provided table:"));
+	acpi_tb_print_table_header(address, table);
+	status = acpi_tb_store_table(address, table, table_entry_size,
+				     ACPI_TABLE_ORIGIN_MAPPED, &tmp);
+				}
+			}
+		} else
+			break;
+	}
 	return_ACPI_STATUS(AE_OK);
 }
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 01e6c6d..70c00ed 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -111,6 +111,12 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table,
 				u32 *new_table_length);
 #endif
 
+#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_add
+acpi_status
+acpi_os_physical_table_add(acpi_physical_address * new_address,
+			   u32 *new_table_length);
+#endif
+
 /*
  * Spinlock primitives
  */
-- 
1.7.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ