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

The checklist for one host

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.

Show 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.

Count the IOMMU groups
ls /sys/kernel/iommu_groups/ | wc -l

The smt control file shows whether hyper-threading is on.

Show whether hyper-threading is on
cat /sys/devices/system/cpu/smt/control

The test for the EFI folder shows the boot mode. It prints UEFI on a UEFI host, and BIOS otherwise.

Show the boot mode
[ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

Why 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.

  1. 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.

  2. Count the IOMMU groups.

    ls /sys/kernel/iommu_groups/ | wc -l

    What you should see: The count is a number. A number above zero means IOMMU groups exist.

  3. Check whether hyper-threading is on.

    cat /sys/devices/system/cpu/smt/control

    What you should see: The smt control file shows whether hyper-threading is on.

  4. Check the boot mode of the host.

    [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS

    What 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?.