Checking firmware settings from Linux
Video 099 of 140 in Virtualization Foundations, in the unit “Firmware settings that matter on a virtualization host”. 3:03, with English and Hindi audio.
Once a host is built, its firmware settings need confirming. Linux can show most of them, but it can change only a few, so most changes happen in the firmware setup and need a restart. This article gives a short checklist for one host, and the Linux commands that check each item. Run them after every firmware change, so a quiet reset does not go unnoticed.
What you will learn
- Linux shows most firmware settings, but it cannot change most of them.
- Check virtualisation, IOMMU groups, NUMA nodes, hyper-threading and boot mode.
- Most settings change only in the firmware setup, which needs a restart.
- Repeat the checks after every firmware update or board swap.
- Keep the output, and compare it with the standard for that host model.
The checklist for one host
- Virtualisation: is the processor's virtualisation feature on? Look for vmx or svm.
- Devices: are IOMMU groups present, and does a network card offer virtual cards?
- Threads and memory: how many logical processors are there, and how many NUMA nodes?
- Boot: is the host in UEFI mode, and is Secure Boot on?
Which settings Linux can read and which it cannot change
Virtualisation, the IOMMU, SR-IOV, boot mode and Secure Boot are set in firmware. Only a restart and a visit to that menu can change them. A few settings, such as hyper-threading and the CPU speed policy, can be changed while Linux runs.
Each item on the checklist can be read from Linux with a command, although the command can differ by host.
Run the checks from Linux
The lscpu command, filtered, shows the virtualisation feature and the NUMA node count.
lscpu | grep -E 'Virtualization|NUMA node\(s\)'Counting the entries in the IOMMU groups directory tells you whether groups exist. A number above zero means they do.
ls /sys/kernel/iommu_groups/ | wc -lThe smt control file shows whether hyper-threading is on.
cat /sys/devices/system/cpu/smt/controlThe test for the EFI folder shows the boot mode. It prints UEFI on a UEFI host, and BIOS otherwise.
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOSWhy repeat the check, and what to do with a failure
A firmware update or a board swap can quietly reset a setting, and a virtual machine may fail later. For a team like Harbor Point, the sensible habit is to run this check on each host after every firmware update.
A failed check tells you where to look, such as the card's firmware setting or its model. Keep the output, and compare it with the standard for that host model.
Run the firmware checklist on Linux
You need a Linux host and a shell. Your values will differ from the examples, so compare them with the standard for your host model.
Show the virtualisation line and the NUMA node count.
lscpu | grep -E 'Virtualization|NUMA node\(s\)'What you should see: The lscpu line shows the virtualisation feature, and the NUMA node count.
Count the IOMMU groups.
ls /sys/kernel/iommu_groups/ | wc -lWhat you should see: The count is a number. A number above zero means IOMMU groups exist.
Check whether hyper-threading is on.
cat /sys/devices/system/cpu/smt/controlWhat you should see: The smt control file shows whether hyper-threading is on.
Check the boot mode of the host.
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOSWhat you should see: The check prints UEFI or BIOS, which shows the boot mode.
Terms
- Firmware setup
- The menu inside a server's firmware where settings such as virtualisation are changed. Changing it needs a restart.
- Logical processor
- A processor thread that the operating system counts as one CPU.
Check yourself
Which settings can only be changed in the firmware setup?
Virtualisation, the IOMMU, SR-IOV, boot mode and Secure Boot. Each needs a restart and a visit to that menu.
Which file shows whether hyper-threading is on?
The file /sys/devices/system/cpu/smt/control, read with cat, shows whether it is on.
What does the boot mode check print on a UEFI host?
It prints UEFI, because the folder /sys/firmware/efi exists. On a host without it, the check prints BIOS.
Previous: UEFI boot mode and Secure Boot on a host. Next: What is a shell?.