diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-14 13:03:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-14 13:03:23 -0500 |
commit | 18dd0bf22b6f0c1bd5e4e813a42245ed86ec57b6 (patch) | |
tree | a4794b6041b44fa94f5d9438cdb5bbfc58b35f05 /Documentation/acpi | |
parent | 2d9c8b5d6a5f5f7a6111cc68a050b5b44729376b (diff) | |
parent | 385ddeac7ed99cf7dc62d76274d55fbd7cae1b5a (diff) |
Merge branch 'x86-acpi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 ACPI update from Peter Anvin:
"This is a patchset which didn't make the last merge window. It adds a
debugging capability to feed ACPI tables via the initramfs.
On a grander scope, it formalizes using the initramfs protocol for
feeding arbitrary blobs which need to be accessed early to the kernel:
they are fed first in the initramfs blob (lots of bootloaders can
concatenate this at boot time, others can use a single file) in an
uncompressed cpio archive using filenames starting with "kernel/".
The ACPI maintainers requested that this patchset be fed via the x86
tree rather than the ACPI tree as the footprint in the general x86
code is much bigger than in the ACPI code proper."
* 'x86-acpi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
X86 ACPI: Use #ifdef not #if for CONFIG_X86 check
ACPI: Fix build when disabled
ACPI: Document ACPI table overriding via initrd
ACPI: Create acpi_table_taint() function to avoid code duplication
ACPI: Implement physical address table override
ACPI: Store valid ACPI tables passed via early initrd in reserved memblock areas
x86, acpi: Introduce x86 arch specific arch_reserve_mem_area() for e820 handling
lib: Add early cpio decoder
Diffstat (limited to 'Documentation/acpi')
-rw-r--r-- | Documentation/acpi/initrd_table_override.txt | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/Documentation/acpi/initrd_table_override.txt b/Documentation/acpi/initrd_table_override.txt new file mode 100644 index 000000000000..35c3f5415476 --- /dev/null +++ b/Documentation/acpi/initrd_table_override.txt | |||
@@ -0,0 +1,94 @@ | |||
1 | Overriding ACPI tables via initrd | ||
2 | ================================= | ||
3 | |||
4 | 1) Introduction (What is this about) | ||
5 | 2) What is this for | ||
6 | 3) How does it work | ||
7 | 4) References (Where to retrieve userspace tools) | ||
8 | |||
9 | 1) What is this about | ||
10 | --------------------- | ||
11 | |||
12 | If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible to | ||
13 | override nearly any ACPI table provided by the BIOS with an instrumented, | ||
14 | modified one. | ||
15 | |||
16 | For a full list of ACPI tables that can be overridden, take a look at | ||
17 | the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in drivers/acpi/osl.c | ||
18 | All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should | ||
19 | be overridable, except: | ||
20 | - ACPI_SIG_RSDP (has a signature of 6 bytes) | ||
21 | - ACPI_SIG_FACS (does not have an ordinary ACPI table header) | ||
22 | Both could get implemented as well. | ||
23 | |||
24 | |||
25 | 2) What is this for | ||
26 | ------------------- | ||
27 | |||
28 | Please keep in mind that this is a debug option. | ||
29 | ACPI tables should not get overridden for productive use. | ||
30 | If BIOS ACPI tables are overridden the kernel will get tainted with the | ||
31 | TAINT_OVERRIDDEN_ACPI_TABLE flag. | ||
32 | Complain to your platform/BIOS vendor if you find a bug which is so sever | ||
33 | that a workaround is not accepted in the Linux kernel. | ||
34 | |||
35 | Still, it can and should be enabled in any kernel, because: | ||
36 | - There is no functional change with not instrumented initrds | ||
37 | - It provides a powerful feature to easily debug and test ACPI BIOS table | ||
38 | compatibility with the Linux kernel. | ||
39 | |||
40 | |||
41 | 3) How does it work | ||
42 | ------------------- | ||
43 | |||
44 | # Extract the machine's ACPI tables: | ||
45 | cd /tmp | ||
46 | acpidump >acpidump | ||
47 | acpixtract -a acpidump | ||
48 | # Disassemble, modify and recompile them: | ||
49 | iasl -d *.dat | ||
50 | # For example add this statement into a _PRT (PCI Routing Table) function | ||
51 | # of the DSDT: | ||
52 | Store("HELLO WORLD", debug) | ||
53 | iasl -sa dsdt.dsl | ||
54 | # Add the raw ACPI tables to an uncompressed cpio archive. | ||
55 | # They must be put into a /kernel/firmware/acpi directory inside the | ||
56 | # cpio archive. | ||
57 | # The uncompressed cpio archive must be the first. | ||
58 | # Other, typically compressed cpio archives, must be | ||
59 | # concatenated on top of the uncompressed one. | ||
60 | mkdir -p kernel/firmware/acpi | ||
61 | cp dsdt.aml kernel/firmware/acpi | ||
62 | # A maximum of: #define ACPI_OVERRIDE_TABLES 10 | ||
63 | # tables are currently allowed (see osl.c): | ||
64 | iasl -sa facp.dsl | ||
65 | iasl -sa ssdt1.dsl | ||
66 | cp facp.aml kernel/firmware/acpi | ||
67 | cp ssdt1.aml kernel/firmware/acpi | ||
68 | # Create the uncompressed cpio archive and concatenate the original initrd | ||
69 | # on top: | ||
70 | find kernel | cpio -H newc --create > /boot/instrumented_initrd | ||
71 | cat /boot/initrd >>/boot/instrumented_initrd | ||
72 | # reboot with increased acpi debug level, e.g. boot params: | ||
73 | acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF | ||
74 | # and check your syslog: | ||
75 | [ 1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] | ||
76 | [ 1.272091] [ACPI Debug] String [0x0B] "HELLO WORLD" | ||
77 | |||
78 | iasl is able to disassemble and recompile quite a lot different, | ||
79 | also static ACPI tables. | ||
80 | |||
81 | |||
82 | 4) Where to retrieve userspace tools | ||
83 | ------------------------------------ | ||
84 | |||
85 | iasl and acpixtract are part of Intel's ACPICA project: | ||
86 | http://acpica.org/ | ||
87 | and should be packaged by distributions (for example in the acpica package | ||
88 | on SUSE). | ||
89 | |||
90 | acpidump can be found in Len Browns pmtools: | ||
91 | ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump | ||
92 | This tool is also part of the acpica package on SUSE. | ||
93 | Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels: | ||
94 | /sys/firmware/acpi/tables | ||