← Documents Documentation/admin-guide/acpi/initrd_table_override.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / ACPI

Upgrading ACPI tables via initrd

initrd로 BIOS ACPI table을 교체·추가하기 위한 build option, AML 추출·수정·cpio 적재 절차와 도구를 설명합니다.

Source pathDocumentation/admin-guide/acpi/initrd_table_override.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Upgrade capability

initrd_table_override.rst:1-30

기능 활성화 option, override 가능 범위와 RSDP/FACS 예외를 정리합니다.

Use cases

initrd_table_override.rst:31-49

BIOS 수정 전 workaround, vendor 호환 환경과 ACPI debugging에 사용합니다.

Override procedure

initrd_table_override.rst:50-100

Table 추출·수정·compile·cpio packaging·boot verification의 전체 절차입니다.

Userspace tools

initrd_table_override.rst:101-115

ACPICA와 pmtools의 iasl, acpixtract, acpidump 출처를 안내합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

initrd를 통한 ACPI table upgrade

1-30

이 GPL-2.0 문서는 initrd를 사용해 ACPI table을 upgrade하는 방법을 설명합니다. `ACPI_TABLE_UPGRADE` compile option이 true이면 BIOS가 제공한 ACPI table을 instrumentation한 수정본 또는 더 최신 version으로 교체하거나 완전히 새로운 ACPI table을 설치해 ACPI execution environment를 upgrade할 수 있습니다.

Kernel과 initrd를 단일 image로 build할 때 이 기능을 쓰려면 `ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRD`도 true여야 합니다.

Upgrade하거나 설치할 수 있는 ACPI table 전체 목록은 `drivers/acpi/tables.c`의 `char *table_sigs[MAX_ACPI_SIGNATURE];` 정의를 확인합니다. Intel ACPI compiler/disassembler인 `iasl`이 아는 table은 원칙적으로 모두 override할 수 있지만, signature가 6 bytes인 `ACPI_SIG_RSDP`와 일반 ACPI table header가 없는 `ACPI_SIG_FACS`는 예외입니다. 두 예외도 구현은 가능합니다.

ACPI table override prerequisites
ItemRequirement or reason
ACPI_TABLE_UPGRADEMust be true
ACPI_TABLE_OVERRIDE_VIA_BUILTIN_INITRDAlso true when kernel and initrd share one image
ACPI_SIG_RSDPExcluded: 6-byte signature
ACPI_SIG_FACSExcluded: no ordinary ACPI table header

기능 활성화 조건과 현재 예외를 구분합니다.

이 기능의 목적

31-49

Linux kernel에 workaround가 받아들여지지 않을 만큼 심각한 bug를 발견하면 platform/BIOS vendor에 문제를 제기해야 합니다. 이 기능을 사용하면 vendor가 upgrade된 BIOS binary를 내놓기 전에 결함 있는 table을 먼저 교체할 수 있습니다.

Platform/BIOS vendor는 기반 platform firmware를 수정하지 않고도 Linux-compatible environment를 제공하는 데 이 기능을 사용할 수 있습니다.

기존 platform ACPI table을 수정하거나 새 table을 삽입해 ACPI BIOS table과 Linux kernel의 compatibility를 쉽게 debug하고 test하는 강력한 수단이기도 합니다.

Instrumentation하지 않은 initrd에서는 기능 변화가 없으므로 어느 kernel에서나 활성화할 수 있고 활성화하는 것이 좋습니다.

ACPI table 추출·수정·적재 절차

50-100

Machine의 ACPI table을 `acpidump`와 `acpixtract`로 추출하고 `iasl`로 disassemble합니다. 예제는 DSDT의 `_PRT` function에 debug message를 추가하고 OEM Revision을 `0x00000000`에서 `0x00000001`로 올린 뒤 다시 compile합니다.

생성한 raw table은 uncompressed cpio archive 안의 `/kernel/firmware/acpi` directory에 둡니다. Table Signature, OEMID, OEM Table ID가 platform table과 같고 OEM Revision이 더 최신이면 기존 table을 upgrade합니다. 세 identity 중 하나라도 다르면 새 table로 append합니다.

현재 허용하는 initrd ACPI table 수는 `NR_ACPI_INITRD_TABLES (64)`입니다. Uncompressed cpio archive가 먼저 와야 하며, 기존의 보통 compressed initrd archive를 그 뒤에 이어 붙입니다. Reboot할 때 ACPI debug level과 layer를 높이고 syslog에서 `_PRT`와 `HELLO WORLD` message를 확인합니다.

::

  # Extract the machine's ACPI tables:
  cd /tmp
  acpidump >acpidump
  acpixtract -a acpidump
  # Disassemble, modify and recompile them:
  iasl -d *.dat
  # For example add this statement into a _PRT (PCI Routing Table) function
  # of the DSDT:
  Store("HELLO WORLD", debug)
  # And increase the OEM Revision. For example, before modification:
  DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
  # After modification:
  DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
  iasl -sa dsdt.dsl
  # Add the raw ACPI tables to an uncompressed cpio archive.
  # They must be put into a /kernel/firmware/acpi directory inside the cpio
  # archive. Note that if the table put here matches a platform table
  # (similar Table Signature, and similar OEMID, and similar OEM Table ID)
  # with a more recent OEM Revision, the platform table will be upgraded by
  # this table. If the table put here doesn't match a platform table
  # (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
  # ID), this table will be appended.
  mkdir -p kernel/firmware/acpi
  cp dsdt.aml kernel/firmware/acpi
  # A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
  # (see osl.c):
  iasl -sa facp.dsl
  iasl -sa ssdt1.dsl
  cp facp.aml kernel/firmware/acpi
  cp ssdt1.aml kernel/firmware/acpi
  # The uncompressed cpio archive must be the first. Other, typically
  # compressed cpio archives, must be concatenated on top of the uncompressed
  # one. Following command creates the uncompressed cpio archive and
  # concatenates the original initrd on top:
  find kernel | cpio -H newc --create > /boot/instrumented_initrd
  cat /boot/initrd >>/boot/instrumented_initrd
  # reboot with increased acpi debug level, e.g. boot params:
  acpi.debug_level=0x2 acpi.debug_layer=0xFFFFFFFF
  # and check your syslog:
  [    1.268089] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
  [    1.272091] [ACPI Debug]  String [0x0B] "HELLO WORLD"

`iasl`은 다양한 ACPI table을 disassemble하고 recompile할 수 있으며, static ACPI table도 상당수 처리합니다.

initrd ACPI table override
acpidumpacpixtractiasl -dModify AML source and bump OEM Revisioniasl -sa
Place AML under kernel/firmware/acpiCreate uncompressed newc cpio firstAppend original initrdBoot with ACPI debugVerify syslog

Platform table 추출부터 boot-time 교체 확인까지의 전체 순서입니다.

Override matching decision
ComparisonResult
Same Table Signature, OEMID and OEM Table ID; newer OEM RevisionUpgrade matching platform table
Different Table Signature, OEMID or OEM Table IDAppend as a new table

Identity와 OEM Revision에 따라 table을 교체하거나 추가합니다.

Userspace tool 구하기

101-115

`iasl`과 `acpixtract`는 Intel ACPICA project(`https://acpica.org/`)의 일부이며 distribution package로 제공되어야 합니다. SUSE에서는 예를 들어 `acpica` package에 들어 있습니다.

`acpidump`는 Len Brown의 pmtools(`ftp://kernel.org/pub/linux/kernel/people/lenb/acpi/utils/pmtools/acpidump`)에서 구할 수 있고 SUSE의 `acpica` package에도 포함됩니다.

또 다른 방법으로 최신 kernel에서는 사용 중인 ACPI table을 `/sys/firmware/acpi/tables`에서 가져올 수 있습니다.

ACPI userspace tools
ToolPurposeSource
iaslDisassemble and compile ACPI tablesIntel ACPICA
acpixtractExtract tables from acpidump outputIntel ACPICA
acpidumpDump machine ACPI tablesLen Brown pmtools / ACPICA packages

추출과 compile에 필요한 도구의 출처입니다.