Skip to contentSkip to conversation

ACPI: Store valid ACPI tables passed via early initrd in reserved memblock areas

tip:x86/acpi tip-bot for Thomas Renninger 1 participant 1 message Sep 28, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Commit-ID:  9b17afd44dadf5065c46bc8e4df55b938d92c529
Gitweb:     http://git.kernel.org/tip/9b17afd44dadf5065c46bc8e4df55b938d92c529
Author:     Thomas Renninger <[email protected]>
AuthorDate: Wed, 26 Sep 2012 14:18:58 +0200
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Thu, 27 Sep 2012 15:01:22 -0700

ACPI: Store valid ACPI tables passed via early initrd in reserved memblock areas

A later patch will compare them with ACPI tables that get loaded at boot or runtime and if criteria match, a stored one is loaded.

---
 arch/x86/kernel/setup.c |    2 +
 drivers/acpi/Kconfig    |    9 ++++
 drivers/acpi/osl.c      |  122 +++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/acpi.h    |    8 +++
 4 files changed, 141 insertions(+), 0 deletions(-)
arch/x86/kernel/setup.c +2 -0
index f4b9b80..764e543 100644
@@ -941,6 +941,8 @@ void __init setup_arch(char **cmdline_p)
 
 	reserve_initrd();
 
+	acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start);
+
 	reserve_crashkernel();
 
 	vsmp_init();
drivers/acpi/Kconfig +9 -0
index 8099895..c461ca1 100644
@@ -261,6 +261,15 @@ config ACPI_CUSTOM_DSDT
 	bool
 	default ACPI_CUSTOM_DSDT_FILE != ""
 
+config ACPI_INITRD_TABLE_OVERRIDE
+	bool
+	default n
+	help
+	  This option provides functionality to override arbitrary ACPI tables
+	  via initrd. No functional change if no ACPI tables are passed via
+	  initrd, therefore it's safe to say Y.
+	  See Documentation/acpi/initrd_table_override.txt for details
+
 config ACPI_BLACKLIST_YEAR
 	int "Disable ACPI for systems before Jan 1st this year" if X86_32
 	default 0
drivers/acpi/osl.c +122 -0

128 lines not on this page · raw message

include/linux/acpi.h +8 -0
index ebecc46..4204fd2 100644
@@ -76,6 +76,14 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
 
 typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
 
+#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
+void acpi_initrd_override(void *data, size_t size);
+#else
+static inline void acpi_initrd_override(void *data, size_t size)
+{
+}
+#endif
+
 char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
 void __acpi_unmap_table(char *map, unsigned long size);
 int early_acpi_boot_init(void);