📜 ⬆️ ⬇️

That the new versions of the UEFI standards are prepared for us, part two, ACPI 6.0

We continue our acquaintance with the new features of the standards recently released from the pen of the UEFI Forum, and if the previous part dealt with the internal standard PI, then this time it will focus on ACPI 6.0 and how it differs from the previous version 5.1.
If you are wondering what exactly has changed in 10 months of development of the standard, and what innovations will please or upset future systems with ACPI 6.0 support - welcome under cat.

What is ACPI?

ACPI or Advanced Configuration and Power Interface is an open standard for interoperability of OS and firmware, developed jointly by engineers from Hewlett-Packard, Intel, Microsoft, Phoenix and Toshiba. The first release was released in December 1996 and included both improved analogues of APM , MPS and PnPBIOS , as well as its own groundwork for detecting connected equipment, monitoring, power management and cooling.
The ACPI interface is almost independent of the architecture of the target machine and consists of a set of tables that contain either data ( SMBIOS and DMI information , for example, or a license key for Windows 8), or AML code. This code is executed by a special interpreter driver, which must be present in each ACPI-compatible OS. The first such OS was Windows 98, but the ACPI implementation at that time was lame in both legs from both the BIOS developers and MS, and therefore to Windows Vista (and the Linux 2.6.0 kernel, if you look at the other side of the barricades ) the interface is not actually used.
However, the standard quickly became popular (not without pressure from Intel and Microsoft) and has already gone through 6 editions. In version 2.0 they added support for 64-bit processors, in 3.0 - SATA, PCIe, temperature control of components (ie, not only CPU) and large multiprocessor systems, in 4.0 - USB3 and x2APIC , in 5.0 - GPIO, simple peripheral buses ( I2C, SPI, UART) and memory power management.
At present, ACPI is most heavily involved in MacOS X, Windows desktop and server editions also require BIOS to have at least ACPI 2.0 support, and Linux and FreeBSD can still work without ACPI without any special problems, but use the interface if successful. to discover.

ACPI 6.0

Since the release of the previous version 5.1. Almost a year has passed, but there have been no radical changes in the new standard, which will allow manufacturers of firmware to implement its support in a relatively short time.
To begin, I will list all the noticeable changes, and then I will try to give a detailed comment on each group. Go!

NVDIMM support
Support for Non-Volatile Memory Firmware Interfaces — add a new NFIT ACPI table from which the OS can find out exactly which parts of the CPU address space the NVDIMM is mapped to and how exactly the OS can use it. What is it for and why is it great - read below.
Extended Vendor Range for E820 Address Types and UEFI Memory Types - add new memory types for old (E820) and new (UEFI MemMap) memory cards, in addition to NFIT for those operating systems that have not been heard of yet.
Persistent memory S4 behavior - the ability to use NVDIMM instead of S4 data storage, which will save Windows users from the hiberfil.sys file, and generally blur the line between S3 (aka Sleep) and S4 (aka Hibernate) for an ordinary user.
')
USB-C support
Add USB-C Connection support to _UPC - now you can find out from each USB port whether it is a USB Type C port and, if so, which new modes it supports.

ASL Update
ASL: Printf and Fprintf Debug Macros - new macros for formatted output, greatly simplifying the writing of debugging code on ASL (before that, it was necessary to fence kilometers of nested Concatenate).
ASL: Helper Macro ToPLD () is another useful macro that allows you to fill in _PLD objects that are used to describe the physical position of devices in the system (i.e. something like “USB3 port — the first one on the left in the second row of ports on the back panel "), And which previously was filled with a series of calls to the Store (with the ability to forget to fill in some fields and rewrite the already filled).
ASL: Extensions for Symbolic Operators and Expressions (ASL 2.0) is an incredibly remarkable change, after which the ASL code will be twice as pleasant to write and ten times more pleasant to read, because now instead of Add (X, Y, Z) you can write Z = X + Y, and instead of LGreaterEqual (X, Y) - X> = Y. I have been waiting for such a game, damn it!

Temperature, power and performance
Standby Thermal Trip - the possibility of a strong excess of the temperature of any part of the board go to S3 instead of completely shutting down, which will lose less data.
Adding Support for Faster Thermal Sampling - an opportunity for the motherboard manufacturer to indicate the polling period for temperature sensors (the minimum value is 0.1 s), which was not there before. Will improve the speed of the reaction of the driver OSPM to changes in temperature components.
Adjust max p-states - support for more than 16 intermediate power states (in simple terms - “CPU multiplier – desired voltage” pairs) for a system under load (ie, C0). Will more accurately save a little more energy on mobile PCs.
ACPI Low Power Idle Table and _LPD proposal - a new table and method for switching to energy-saving LPI states. They work so far only on Haswell and newer Intel processors, only on Windows and only with the Intel Power Engine Plug-in, so far there is not much use of this innovation.
CPPC heterogeneous performance capabilities — support for Intel's CPPC technology. Another way to manage the load, in addition to the top ten already available. Also only for Haswell +, but this time the driver for Linux is not cheated.

ARM architecture support
Reserve IORT and support for ARM GIC v3 / 4 in MADT - the name of the IORT table is reserved for future versions of the standard, support for the ARM GIC interrupt controller has been added to MADT . Step by step, UEFI Forum adds ARM support to its standards, a couple more years, and desktop Windows starts to start on ARM systems with UEFI and ACPI ...

Rest
Reserve STAO and XENV table signatures - a couple of tables are reserved for adding to future versions of the standard. STAO will allow the OSPM driver to ignore some part of the ACPI code (which may be necessary, for example, on Chinese tablets, where ACPI often creates trash, waste and sodomy, and just drop all the tables during the OS boot - too drastically), and XENV is needed Xen hypervisor to transfer data to Dom0.
FADT Hypervisor Vendor Identification Support is a new 64-bit field in the FADT table in which the hypervisor can inform the OS of its presence and type.
Support for Platform-specific device reset - support for a new type of resets, which I already wrote about in the first part.
Generic Button (s) Abstraction - finally, another pleasant thing about ASL 2.0, which I was waiting for the same year, button support for any purpose, not just Power / Reset / Lid / Sleep. No more driver curves causing SMI for every sneeze, no volume adjustment via DMI, the ASL code is written to the buttons once and they work out of the box.

Quite a bit about NVDIMM

He promised to tell you what support for NVDIMM is fraught with a simple user - and I will tell you.
Even without the NVDIMM itself (the advantages of which can be read, for example, here ), the NFIT table will allow the firmware to display any continuous file in memory and tell the OS that it is there and that it can boot from. This, in turn, will allow UEFI to be loaded not only from physical media, but also from ISO images, from virtual disks, from any block devices (even without FS), etc. The chip, most likely, was peeped from GRUB, who has been able to do that for ten years now, but this doesn’t make it any less useful.

Conclusion

Unlike PI 1.4, in which there was almost nothing interesting, the new version of ACPI added some pleasant ones both for the user (NFIT, buttons, USB-C) and the developer (ASL 2.0, new macros, more options for temperature control) of things. Well, UEFI Forum itself was not cheated by adding all the recent energy-saving technologies from Intel and leaving a reserve for a future version for ARM and Linaro.
We are waiting for now, when manufacturers of UEFI-platforms (ie, AMI, Phoenix and Insyde) will announce and support ACPI 6.0 in their products.

PS
I apologize for the abundance of abbreviations, but there is no other way.
Thank you for your attention, you successful firmware.

Source: https://habr.com/ru/post/259477/


All Articles