ACPI explained

Advanced Configuration and Power Interface
Abbreviation:ACPI
Status:Published
First Published:December 1996
Version:6.5
Version Date:August 2022
Related Standards:UEFI
Domain:Power management firmware

Advanced Configuration and Power Interface (ACPI) is an open standard that operating systems can use to discover and configure computer hardware components, to perform power management (e.g. putting unused hardware components to sleep), auto configuration (e.g. Plug and Play and hot swapping), and status monitoring. It was first released in December 1996. ACPI aims to replace Advanced Power Management (APM), the MultiProcessor Specification, and the Plug and Play BIOS (PnP) Specification.[1] ACPI brings power management under the control of the operating system, as opposed to the previous BIOS-centric system that relied on platform-specific firmware to determine power management and configuration policies.[2] The specification is central to the Operating System-directed configuration and Power Management (OSPM) system. ACPI defines hardware abstraction interfaces between the device's firmware (e.g. BIOS, UEFI), the computer hardware components, and the operating systems.[3] [4]

Internally, ACPI advertises the available components and their functions to the operating system kernel using instruction lists ("methods") provided through the system firmware (UEFI or BIOS), which the kernel parses. ACPI then executes the desired operations written in ACPI Machine Language (such as the initialization of hardware components) using an embedded minimal virtual machine.

Intel, Microsoft and Toshiba originally developed the standard, while HP, Huawei and Phoenix also participated later. In October 2013, ACPI Special Interest Group (ACPI SIG), the original developers of the ACPI standard, agreed to transfer all assets to the UEFI Forum, in which all future development will take place.[5] of the standard 6.5 was released in August 2022.[6]

Architecture

The firmware-level ACPI has three main components: the ACPI tables, the ACPI BIOS, and the ACPI registers. The ACPI BIOS generates ACPI tables and loads ACPI tables into main memory. Much of the firmware ACPI functionality is provided in bytecode of ACPI Machine Language (AML), a Turing-complete, domain-specific low-level language, stored in the ACPI tables.[7] To make use of the ACPI tables, the operating system must have an interpreter for the AML bytecode. A reference AML interpreter implementation is provided by the ACPI Component Architecture (ACPICA). At the BIOS development time, AML bytecode is compiled from the ASL (ACPI Source Language) code.[8]

ACPI Component Architecture (ACPICA)

The ACPI Component Architecture (ACPICA), mainly written by Intel's engineers, provides an open-source platform-independent reference implementation of the operating system - related ACPI code.[9] The ACPICA code is used by Linux, Haiku, ArcaOS[10] and FreeBSD,[11] which supplement it with their operating-system specific code.

History

The first revision of the ACPI specification was released in December 1996, supporting 16, 24 and 32-bit addressing spaces. It was not until August 2000 that ACPI received 64-bit address support as well as support for multiprocessor workstations and servers with revision 2.0.

In 1999, then Microsoft CEO Bill Gates stated in an e-mail that Linux would benefit from ACPI without them having to do work and suggested to make it Windows-only.[12] [13] [14]

In September 2004, revision 3.0 was released, bringing to the ACPI specification support for SATA interfaces, PCI Express bus, multiprocessor support for more than 256 processors, ambient light sensors and user-presence devices, as well as extending the thermal model beyond the previous processor-centric support.

Released in June 2009, revision 4.0 of the ACPI specification added various new features to the design; most notable are the USB 3.0 support, logical processor idling support, and x2APIC support.

Revision 5.0 of the ACPI specification was released in December 2011,[15] which added the ARM architecture support. The revision 5.1 was released in July 2014.[16]

The latest specification revision is 6.5, which was released in August 2022.

Operating systems

Microsoft's Windows 98 was the first operating system to implement ACPI,[17] [18] but its implementation was somewhat buggy or incomplete,[19] [20] although some of the problems associated with it were caused by the first-generation ACPI hardware.[21] Other operating systems, including later versions of Windows, macOS, eComStation, ArcaOS,[22] FreeBSD (since FreeBSD 5.0[23]), NetBSD (since NetBSD 1.6[24]), OpenBSD (since OpenBSD 3.8[25]), HP-UX, OpenVMS, Linux, GNU Hurd and PC versions of Solaris, have at least some support for ACPI.[26] Some newer operating systems, like Windows Vista, require the computer to have an ACPI-compliant BIOS, and since Windows 8, the S0ix/Modern Standby state was implemented.[27]

Windows operating systems use acpi.sys[28] to access ACPI events.

The 2.4 series of the Linux kernel had only minimal support for ACPI, with better support implemented (and enabled by default) from kernel version 2.6.0 onwards.[29] Old ACPI BIOS implementations tend to be quite buggy, and consequently are not supported by later operating systems. For example, Windows 2000, Windows XP, and Windows Server 2003 only use ACPI if the BIOS date is after January 1, 1999.[30] Similarly, Linux kernel 2.6 may not use ACPI if the BIOS date is before January 1, 2001.[29]

Linux-based operating systems can provide handling of ACPI events via acpid.[31]

OSPM responsibilities

Once an OSPM-compatible operating system activates ACPI, it takes exclusive control of all aspects of power management and device configuration. The OSPM implementation must expose an ACPI-compatible environment to device drivers, which exposes certain system, device and processor states.

Power states

Global states

The ACPI Specification defines the following four global "Gx" states and six sleep "Sx" states for an ACPI-compliant computer system:[32] [33]

!Gx!Name!Sx!Description
G0WorkingS0The computer is running and the CPU executes instructions. "Awaymode" is a subset of S0, where monitor is off but background tasks are running
G1SleepingS0ixModern Standby,[34] or "Low Power S0 Idle". Partial processor SoC sleep.[35] [36] Known to ARM and x86 devices.
S1Power on Suspend (POS): Processor caches are flushed, and the CPU(s) stops executing instructions. The power to the CPU(s) and RAM is maintained. Peripherals such as monitor and hard disk may be turned off.
S2CPU powered off. Dirty cache is flushed to RAM.
S3Commonly referred to as Standby, Sleep, or Suspend to RAM (STR): RAM remains powered. Most peripherals are turned off. Fans are usually turned off. Requires GPU drivers on Windows.
S4Hibernation or Suspend to Disk: All content of the main memory is saved to non-volatile memory such as a hard drive, and the system is powered down.
G2Soft OffS5Shutdown

system is powered down.

G3Mechanical OffThe computer's power has been totally removed via a mechanical switch (as on the rear of a PSU). The power cord can be removed and the system is safe for disassembly (typically, only the real-time clock continues to run using its own small battery).
The specification also defines a Legacy state: the state of an operating system which does not support ACPI. In this state, the hardware and power are not managed via ACPI, effectively disabling ACPI.

Device states

The device states D0D3 are device dependent:

Processor states

The CPU power states C0C3 are defined as follows:

Performance state

While a device or processor operates (D0 and C0, respectively), it can be in one of several power-performance states. These states are implementation-dependent. P0 is always the highest-performance state, with P1 to Pn being successively lower-performance states, up to an implementation-specific limit of n no greater than 16.[41]

P-states have become known as SpeedStep in Intel processors, as PowerNow! or Cool'n'Quiet in AMD processors, and as PowerSaver in VIA processors.

Interfaces

Hardware

ACPI-compliant systems interact with hardware through either a "Function Fixed Hardware (FFH) Interface", or a platform-independent hardware programming model which relies on platform-specific ACPI Machine Language (AML) provided by the original equipment manufacturer (OEM).

Function Fixed Hardware interfaces are platform-specific features, provided by platform manufacturers for the purposes of performance and failure recovery. Standard Intel-based PCs have a fixed function interface defined by Intel,[43] which provides a set of core functionality that reduces an ACPI-compliant system's need for full driver stacks for providing basic functionality during boot time or in the case of major system failure.

ACPI Platform Error Interface (APEI) is a specification for reporting of hardware errors, e.g. chipset, RAM to the operating system.

Firmware

ACPI defines many tables that provide the interface between an ACPI-compliant operating system and system firmware (BIOS or UEFI). This includes RSDP, RSDT, XSDT, FADT, FACS, DSDT, SSDT, MADT, and MCFG, for example.[44] [45]

The tables allow description of system hardware in a platform-independent manner, and are presented as either fixed-formatted data structures or in AML. The main AML table is the DSDT (differentiated system description table). The AML can be decompiled by tools like Intel's iASL (open-source, part of ACPICA) for purposes like patching the tables for expanding OS compatibility.[46] [47]

The Root System Description Pointer (RSDP) is located in a platform-dependent manner, and describes the rest of the tables.

A custom ACPI table called the Windows Platform Binary Table (WPBT) is used by Microsoft to allow vendors to add software into the Windows OS automatically. Some vendors, such as Lenovo, have been caught using this feature to install harmful software such as Superfish.[48] Samsung shipped PCs with Windows Update disabled.[48] Windows versions older than Windows 7 do not support this feature, but alternative techniques can be used. This behavior has been compared to rootkits.[49] [50]

Tables

PHAT:Platform Health Assessment Table
  • SLIP:Software Licensing Description Table
  • Criticism

    Ubuntu founder Mark Shuttleworth says ACPI is a security risk.[51] He says "arguing for ACPI on your next-generation device is arguing for a trojan horse of monumental proportions to be installed in your living room and in your data centre" and "firmware on your device is the NSA's best friend". He goes on to say, "Your biggest mistake is to assume that the NSA is the only institution abusing this position of trust – in fact, it's reasonable to assume that all firmware is a cesspool of insecurity, courtesy of incompetence of the highest degree from manufacturers, and competence of the highest degree from a very wide range of such agencies." He suggests open-source, declarative firmware (ACPI or non-ACPI) as a solution.[52]

    Overall design decision was not without criticism. In November 2003, Linus Torvalds—author of the Linux kernel—described ACPI as "a complete design disaster in every way".[53]

    See also

    Further reading

    External links

    Notes and References

    1. Web site: ACPI Overview . www.acpi.info . slide show in PDF . https://web.archive.org/web/20190525060308/http://www.acpi.info/presentations/ACPI_Overview.pdf . 2019-05-25.
    2. Web site: APM BIOS Specification. Intel Corporation, Microsoft Corporation. February 1996. 2010-07-02. RTF. https://web.archive.org/web/20120206030045/http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/APMV12.rtf. February 6, 2012. dead.
    3. Web site: What is ACPI (Advanced Configuration and Power Interface)? - Definition from WhatIs.com. 2020-09-18. SearchWindowsServer. en.
    4. Web site: ACPI Device Tree - Representation of ACPI Namespace — The Linux Kernel documentation. 2020-09-18. www.kernel.org.
    5. Web site: The Advanced Configuration & Power Interface web page has a prominent note that links to the Preexisting ACPI Specifications page on the UEFI web site. July 23, 2014. 2016-01-25. acpi.org. June 22, 2011. https://web.archive.org/web/20110622223107/http://www.acpi.info/. dead.
    6. Web site: Advanced Configuration and Power Interface Specification, Release 6.5. August 2022 . 2022-10-04. UEFI.org/specifications.
    7. Web site: ATARE: ACPI Tables and Regular Expressions. Bernhard Kauer. August 2009 . 2019-02-18.
    8. https://www.kernel.org/doc/ols/2005/ols2005v1-pages-59-76.pdf ACPI in Linux
    9. http://www.acpica.org/ ACPICA: ACPI Component Architecture
    10. Web site: Readme for the ACPI Driver Package. arcanoae.com. 2020-09-06.
    11. http://www.usenix.org/events/usenix02/tech/freenix/full_papers/watanabe/watanabe.ps ACPI implementation on FreeBSD - Usenix
    12. Web site: Microsoft wollte ACPI nur für Windows . 2022-11-06 . . de-AT.
    13. Web site: Microsoft: ACPI sollte nur unter Windows funktionieren . 2022-11-06 . Golem.de.
    14. Web site: Gates . Bill . 1999-01-24 . ACPI extensions . dead . https://web.archive.org/web/20070202174648/http://www.iowaconsumercase.org/011607/3000/PX03020.pdf . 2007-02-02.
    15. Web site: Advanced Configuration and Power Interface Specification (Revision 5.0) . Hewlett-Packard . Hewlett-Packard . Intel Corporation . Intel Corporation . Microsoft . Microsoft . Phoenix Technologies . Phoenix Technologies . Toshiba . Toshiba . 2011-12-06 . 2013-11-17 . acpi.info . September 14, 2012 . https://web.archive.org/web/20120914012029/http://www.acpi.info/DOWNLOADS/ACPIspec50.pdf . dead .
    16. Web site: Advanced Configuration and Power Interface Specification (Revision 5.1) . 2014-07-23 . 2015-05-24 . uefi.org .
    17. Web site: [ftp://ftp.physik.hu-berlin.de/pub/driver/grafik/armada1120/RMF98/DISK1/WINDOW~1.PDF Limitations When Using Microsoft Windows 98 on Compaq Armada Portables ]. 3 . October 1998 . 2014-01-27 . physik.hu-berlin.de.
    18. Web site: Windows 98 on ThinkPad systems - ThinkPad General . https://web.archive.org/web/20140203005405/http://support.lenovo.com/en_US/guides-and-manuals/detail.page?&LegacyDocID=LWIK-3VJLL8 . dead . 2014-02-03 . Support.lenovo.com . 2014-01-27.
    19. Book: Robert Cowart . Brian Knittel . Using Microsoft Windows 2000 Professional . registration . 2000 . Que Publishing . 978-0-7897-2125-9 . 30.
    20. http://support.microsoft.com/kb/189091 Windows 98 Does Not Support ACPI Passive Cooling Mode
    21. Web site: https://web.archive.org/web/19991013055230/http://winmag.com/library/1998/1201/cov0066.htm . October 13, 1999 . winmag.com . Cover Story: Win98 Bugs & Fixes - December 1998 . dead.
    22. Web site: ArcaOS Changelog . 2020-08-24.
    23. Web site: FreeBSD 5.0-RELEASE Announcement . 2020-12-03 . www.freebsd.org.
    24. Web site: acpi(4) - NetBSD Manual Pages . 2020-12-03 . man.netbsd.org.
    25. Web site: acpi(4) - OpenBSD manual pages . 2020-12-03 . man.openbsd.org.
    26. Web site: ACPI 2.0 Specification Technical Review, Intel Developer Forum. 2000-01-06. Guy . Therien. Intel Corporation. 2011-08-21. PPT. https://web.archive.org/web/20110721184817/http://www.acpi.info/presentations/acpi2M0800IDF.ppt . July 21, 2011 . live.
    27. Web site: ACPI in Windows Vista. PPT. Allen . Marshall. Microsoft Corporation. 2010-07-02.
    28. Web site: Acpi.sys: The Windows ACPI Driver. 2017-06-15. Microsoft Corporation. 2019-09-20.
    29. https://www.kernel.org/doc/ols/2004/ols2004v1-pages-121-132.pdf The State of ACPI in the Linux Kernel
    30. https://msdn.microsoft.com/en-us/library/windows/hardware/ff540487(v=vs.85).aspx ACPI BIOS
    31. Book: Linux in a nutshell . 2005 . O'Reilly . Ellen Siever, Ellen Siever . 978-0-596-52949-9 . 5th . Beijing . 36 . 773210086.
    32. ACPI Spec Rev 5.0 - dated December 6, 2011
    33. Web site: Intel's Haswell Architecture Analyzed. 2012-10-05 . 2013-10-20. Anand Lal Shimpi . AnandTech.
    34. Web site: Modern Standby. windows-driver-content. docs.microsoft.com. en-gb. 2020-03-20.
    35. Web site: S0ix States . software.intel.com . en . 9 March 2020.
    36. Web site: Wang . Wendy . How to achieve S0ix states in Linux* . 01.org . 17 October 2018.
    37. Web site: D0ix States . software.intel.com . en . 9 March 2020.
    38. Web site: Athlon II X2: Hardware C1E and Return of the CnQ Bug. AnandTech. 2020-10-26.
    39. Web site: Intel's Pentium 4 600 series processors. Scott . Wasson. 2005-02-21. 2. The Tech Report.
    40. Web site: Processor Package and Core C-States. 2013-06-09 . 2013-10-20. AnandTech.
    41. Web site: Advanced Configuration and Power Interface Specification, Revision 3.0, Section 2.6 Device and Processor Performance State Definitions. 2004-09-02. 2015-08-19. ACPI.info. 23. November 28, 2015. https://web.archive.org/web/20151128143452/http://www.acpi.info/DOWNLOADS/ACPIspec30.pdf. dead.
    42. [Link aggregation]
    43. Web site: [ftp://download.intel.com/technology/iapc/acpi/downloads/30222305.pdf Intel Processor Vendor-Specific ACPI]. https://web.archive.org/web/20121225022426/http://download.intel.com/technology/IAPC/acpi/downloads/30222305.pdf. Intel Corporation. Intel Corporation. September 2006. 2014-10-05. 2012-12-25.
    44. 10.1.1.173.2206. ACPI in Linux. Len. Brown. 2005-07-20. Ottawa Linux Symposium. 3.
    45. Web site: ACPI Tables — The Linux Kernel documentation. 2020-11-08. www.kernel.org. October 20, 2020. https://web.archive.org/web/20201020091509/https://www.kernel.org/doc/html/latest/arm64/acpi_object_usage.html. dead.
    46. Web site: DSDT . ArchWiki.
    47. Web site: Getting Started With ACPI. GitBook.
    48. Web site: Hoffman . Chris . August 19, 2015 . Zombie Crapware: How the Windows Platform Binary Table Works . How-To Geek.
    49. Web site: Vendors 'rootkit': 'Windows Platform Binary Table' (WPBT) . Born's Tech and Windows World . December 6, 2017.
    50. Web site: Mayank Sharma . 2021-09-27 . Millions of Windows 10 PCs exposed by nasty security vulnerability . 2022-11-10 . . en.
    51. Mark Shuttleworth blog (March 17, 2014), "ACPI, firmware and your security"
    52. Linux Magazine issue 162, May 2014, page 9
    53. Web site: Searls . Doc . 2003-11-25 . Linus & the Lunatics, Part II . 2010-01-13 . Linux Journal.