initrd_table_override.txt 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Upgrading ACPI tables via initrd
  2. ================================
  3. 1) Introduction (What is this about)
  4. 2) What is this for
  5. 3) How does it work
  6. 4) References (Where to retrieve userspace tools)
  7. 1) What is this about
  8. ---------------------
  9. If the ACPI_TABLE_UPGRADE compile option is true, it is possible to
  10. upgrade the ACPI execution environment that is defined by the ACPI tables
  11. via upgrading the ACPI tables provided by the BIOS with an instrumented,
  12. modified, more recent version one, or installing brand new ACPI tables.
  13. For a full list of ACPI tables that can be upgraded/installed, take a look
  14. at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
  15. drivers/acpi/tables.c.
  16. All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should
  17. be overridable, except:
  18. - ACPI_SIG_RSDP (has a signature of 6 bytes)
  19. - ACPI_SIG_FACS (does not have an ordinary ACPI table header)
  20. Both could get implemented as well.
  21. 2) What is this for
  22. -------------------
  23. Complain to your platform/BIOS vendor if you find a bug which is so severe
  24. that a workaround is not accepted in the Linux kernel. And this facility
  25. allows you to upgrade the buggy tables before your platform/BIOS vendor
  26. releases an upgraded BIOS binary.
  27. This facility can be used by platform/BIOS vendors to provide a Linux
  28. compatible environment without modifying the underlying platform firmware.
  29. This facility also provides a powerful feature to easily debug and test
  30. ACPI BIOS table compatibility with the Linux kernel by modifying old
  31. platform provided ACPI tables or inserting new ACPI tables.
  32. It can and should be enabled in any kernel because there is no functional
  33. change with not instrumented initrds.
  34. 3) How does it work
  35. -------------------
  36. # Extract the machine's ACPI tables:
  37. cd /tmp
  38. acpidump >acpidump
  39. acpixtract -a acpidump
  40. # Disassemble, modify and recompile them:
  41. iasl -d *.dat
  42. # For example add this statement into a _PRT (PCI Routing Table) function
  43. # of the DSDT:
  44. Store("HELLO WORLD", debug)
  45. # And increase the OEM Revision. For example, before modification:
  46. DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
  47. # After modification:
  48. DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
  49. iasl -sa dsdt.dsl
  50. # Add the raw ACPI tables to an uncompressed cpio archive.
  51. # They must be put into a /kernel/firmware/acpi directory inside the cpio
  52. # archive. Note that if the table put here matches a platform table
  53. # (similar Table Signature, and similar OEMID, and similar OEM Table ID)
  54. # with a more recent OEM Revision, the platform table will be upgraded by
  55. # this table. If the table put here doesn't match a platform table
  56. # (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
  57. # ID), this table will be appended.
  58. mkdir -p kernel/firmware/acpi
  59. cp dsdt.aml kernel/firmware/acpi
  60. # A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
  61. # (see osl.c):
  62. iasl -sa facp.dsl
  63. iasl -sa ssdt1.dsl
  64. cp facp.aml kernel/firmware/acpi
  65. cp ssdt1.aml kernel/firmware/acpi
  66. # The uncompressed cpio archive must be the first. Other, typically
  67. # compressed cpio archives, must be concatenated on top of the uncompressed
  68. # one. Following command creates the uncompressed cpio archive and
  69. # concatenates the original initrd 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. iasl is able to disassemble and recompile quite a lot different,
  78. also static ACPI tables.
  79. 4) Where to retrieve userspace tools
  80. ------------------------------------
  81. iasl and acpixtract are part of Intel's ACPICA project:
  82. http://acpica.org/
  83. and should be packaged by distributions (for example in the acpica package
  84. on SUSE).
  85. acpidump can be found in Len Browns pmtools:
  86. ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump
  87. This tool is also part of the acpica package on SUSE.
  88. Alternatively, used ACPI tables can be retrieved via sysfs in latest kernels:
  89. /sys/firmware/acpi/tables