Blame SPECS/README.caveats

Packit e3b5e1
The microcode_ctl package contains microcode files (vendor-provided binary data
Packit e3b5e1
and/or code in proprietary format that affects behaviour of a device) for Intel
Packit e3b5e1
CPUs that may be loaded into the CPU during boot.
Packit e3b5e1
Packit e3b5e1
The microcode_ctl package contains provisions for some issues related
Packit e3b5e1
to microcode loading.  While those provisions are expected to suit most users,
Packit e3b5e1
several knobs are available in order to provide ability to override the default
Packit e3b5e1
behaviour.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
General behaviour
Packit e3b5e1
=================
Packit e3b5e1
In RHEL 8 (as well as RHEL 7 before it), there are currently two main handlers
Packit e3b5e1
for CPU microcode update:
Packit e3b5e1
 * Early microcode update. It uses GenuineIntel.bin or AuthenticAMD.bin file
Packit e3b5e1
   placed at the beginning of an initramfs image
Packit e3b5e1
   (/boot/initramfs-KERNEL_VERSION.img, where "KERNEL_VERSION" is a kernel
Packit e3b5e1
   version in the same format as provided by "uname -r") as a source
Packit e3b5e1
   of microcode data, and is performed very early during the boot process
Packit e3b5e1
   (if the relevant microcode file is available in the aforementioned file).
Packit e3b5e1
 * On-demand (late) microcode update. It can be triggered by writing "1" to
Packit e3b5e1
   /sys/devices/system/cpu/microcode/reload file (provided my the "microcode"
Packit e3b5e1
   module). It relies on request_firmware infrastructure, which searches (and
Packit e3b5e1
   loads, if found) microcode from a file present in one of the following
Packit e3b5e1
   directories (in the search order):
Packit e3b5e1
       /lib/firmware/updates/KERNEL_VERSION/
Packit e3b5e1
       /lib/firmware/updates/
Packit e3b5e1
       /lib/firmware/KERNEL_VERSION/
Packit e3b5e1
       /lib/firmware/
Packit e3b5e1
  (there is also an additional directory that can be configured via the
Packit e3b5e1
  "fw_path_para" module option of the "firmware_class" module; as this module
Packit e3b5e1
  is built-in in RHEL kernel, a boot parameter "firmware_class.fw_path_para"
Packit e3b5e1
  should be used for that purpose; this is out of the document's scope, however)
Packit e3b5e1
Packit e3b5e1
The firmware for Intel CPUs is searched in "intel-ucode" subdirectory, and for
Packit e3b5e1
AMD CPUs, a file under "amd-ucode" is searched.
Packit e3b5e1
Packit e3b5e1
For Intel CPUs, the name of the specific microcode file the kernel tries to load
Packit e3b5e1
has the format "FF-MM-SS", where "FF" is the family number, "MM" is the model
Packit e3b5e1
number, and "SS" is the stepping. All those numbers are zero-filled to two digits
Packit e3b5e1
and are written in hexadecimal (letters are in the lower case).  For AMD CPUs,
Packit e3b5e1
the file name has the format "microcode_amd_famFFh.bin", where "FF" is the
Packit e3b5e1
family number, written in hexadecimal, letters are in the lower case, not
Packit e3b5e1
zero-filled.
Packit e3b5e1
Packit e3b5e1
The early microcode is placed into initramfs image by the "dracut" script, which
Packit e3b5e1
scans the aforementioned subdirectories of the configured list of firmware
Packit e3b5e1
directories (by default, the list consists of two directories in RHEL 8,
Packit e3b5e1
"/lib/firmware/updates" and "/lib/firmware").
Packit e3b5e1
Packit e3b5e1
In RHEL 8, AMD CPU microcode is shipped as a part of the linux-firmware package,
Packit e3b5e1
and Intel microcode is shipped as a part of the microcode_ctl package.
Packit e3b5e1
Packit e3b5e1
The microcode_ctl package currently includes the following:
Packit e3b5e1
 * Intel CPU microcode files, placed in /usr/share/microcode_ctl/intel-ucode
Packit e3b5e1
   directory (currently there are none);
Packit e3b5e1
 * A dracut module, /usr/lib/dracut/modules.d/99microcode_ctl-fw_dir_override,
Packit e3b5e1
   that controls which additional firmware directories will be added to dracut's
Packit e3b5e1
   default configuration;
Packit e3b5e1
 * A dracut configuration file, /usr/lib/dracut/dracut.conf.d/01-microcode.conf,
Packit e3b5e1
   that enables inclusion of early microcode to the generated initramfs
Packit e3b5e1
   in dracut;
Packit e3b5e1
 * A dracut configuration file,
Packit e3b5e1
   /usr/lib/dracut/dracut.conf.d/99-microcode-override.conf, that provides a way
Packit e3b5e1
   to quickly disable 99microcode_ctl-fw_dir-override dracut module;
Packit e3b5e1
 * A systemd service file, microcode.service, that triggers microcode reload
Packit e3b5e1
   late during boot;
Packit e3b5e1
 * A set of directories in /usr/share/microcode_ctl/ucode_with_caveats, each
Packit e3b5e1
   of which contains configuration and related data for various caveats related
Packit e3b5e1
   to microcode:
Packit e3b5e1
   * readme - description of caveat and related information,
Packit e3b5e1
   * config - caveat configuration file, with syntax as described in "Caveat
Packit e3b5e1
     configuration" section below,
Packit e3b5e1
   * intel-ucode - directory containing microcode files related to the caveat;
Packit e3b5e1
 * A set of support scripts, placed in /usr/libexec/microcode_ctl:
Packit e3b5e1
   * "check_caveats" is an utility script that performs checks of the target
Packit e3b5e1
     kernel (and running CPU) in accordance with caveat configuration files
Packit e3b5e1
     in ucode_with_caveats directory and reports whether it passes them or not,
Packit e3b5e1
   * "reload_microcode" is a script that is called by microcode.service and
Packit e3b5e1
     triggers microcode reloading (by writing "1" to
Packit e3b5e1
     /sys/devices/system/cpu/microcode/reload) if the running kernel passes
Packit e3b5e1
     check_caveats checks,
Packit e3b5e1
   * "update_ucode" is a script that populates symlinks to microcode files
Packit e3b5e1
     in /lib/firmware, so it can be picked up by relevant kernels for the late
Packit e3b5e1
     microcode loading.
Packit e3b5e1
Packit e3b5e1
Also, microcode_ctl RPM includes triggers that run update_ucode script on every
Packit e3b5e1
installation or removal of a kernel RPM in order to provide microcode files
Packit e3b5e1
for newly installed kernels and cleanup symlinks for the uninstalled ones.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Caveat configuration
Packit e3b5e1
--------------------
Packit e3b5e1
There is a directory for each caveat under
Packit e3b5e1
/usr/share/microcode_ctl/ucode_with_caveats, containing the following files:
Packit e3b5e1
 * "config", a configuration file for the caveat;
Packit e3b5e1
 * "readme", that contains description of the caveat;
Packit e3b5e1
 * set of related associated microcode files.
Packit e3b5e1
Packit e3b5e1
"config" file is a set of lines each containing option name and its value,
Packit e3b5e1
separated by white space.  Currently, the following options are supported:
Packit e3b5e1
 * "model" option, which has format "VENDOR_ID FF-MM-SS", that specifies
Packit e3b5e1
   to which CPU model the caveat is applicable (check_caveats ignores caveats
Packit e3b5e1
   with non-matching models if "-m" option is passed to it). Can be set
Packit e3b5e1
   in the configuration file only once (the last provided value is used).
Packit e3b5e1
 * "vendor" option specifies CPUs of which vendor (as provided
Packit e3b5e1
   in the /proc/cpuinfo file) the caveat is applicable to (check_caveats
Packit e3b5e1
   ignores caveats with non-matching models when it is invoked with "-m"
Packit e3b5e1
   option). Can be set in the configuration file only once.
Packit e3b5e1
 * "path" is a glob pattern that specifies set of microcode files associated
Packit e3b5e1
   with the caveat as a relative path to the caveat directory. This option
Packit e3b5e1
   is used for populating files in /lib/firmware by update_ucode script and
Packit e3b5e1
   for matching microcode file when dracut is run in host-only mode
Packit e3b5e1
   (as in that case it uses only the first directory in firmware directory list
Packit e3b5e1
   to look for the microcode file applicable to the host CPU).  Can be set
Packit e3b5e1
   in the configuration file multiple times.
Packit e3b5e1
 * "kernel" is a minimal kernel version that supports proper handling
Packit e3b5e1
   of the related microcode files during late microcode load.  It may be
Packit e3b5e1
   provided in one of the following formats that affect the way it is compared
Packit e3b5e1
   to the running kernel version:
Packit e3b5e1
    * A.B.C (where A, B, and C are decimal numbers), "upstream version". In this
Packit e3b5e1
      case, simple version comparison against the respective part of the running
Packit e3b5e1
      kernel version is used, and the running kernel version should be greater
Packit e3b5e1
      or equal than the version provided in the configuration option in order
Packit e3b5e1
      for comparison to succeed (that is, the first part, major version number,
Packit e3b5e1
      of the running kernel version should be greater than the value provided
Packit e3b5e1
      in the configuration option, or those should be equal and the second part,
Packit e3b5e1
      minor version number, should be greater than the minor version number
Packit e3b5e1
      of the kernel version provided in the configuration option, or the first
Packit e3b5e1
      two parts should be equal and the third part, patch level, should
Packit e3b5e1
      be greater or equal the patch level of the version in the configuration
Packit e3b5e1
      option).
Packit e3b5e1
    * A.B.C-Y (where A, B, C, and Y are decimal numbers), "Y-stream version".
Packit e3b5e1
      In this case, A.B.C part should be equal, and Y part of the running kernel
Packit e3b5e1
      version should be greater or equal than the Y part of the configuration
Packit e3b5e1
      option version in order to satisfy the comparison requirement.
Packit e3b5e1
    * A.B.C-Y.Z1.Z2 (where A, B, C, Y, Z1, and Z2 are decimal numbers),
Packit e3b5e1
      "Z-stream version". In this case, A.B.C-Y part should be equal and Z1.Z2
Packit e3b5e1
      part of the running kernel should be greater or equal than the respective
Packit e3b5e1
      part of the configuration option version (when compared as a version)
Packit e3b5e1
      for comparison to succeed.
Packit e3b5e1
   Kernel version check passed if at least one comparison of the running kernel
Packit e3b5e1
   version against a kernel version provided in a configuration option
Packit e3b5e1
   succeeded.  The "kernel" configuration option can be provided
Packit e3b5e1
   in the configuration file multiple times.
Packit e3b5e1
 * "kernel_early" is a minimal kernel version that supports proper handling
Packit e3b5e1
   of the related microcode during early microcode load. The format of the
Packit e3b5e1
   option and its semantics is similar to the "kernel" configuration options.
Packit e3b5e1
   This option can be provided multiple times as well.
Packit e3b5e1
 * "mc_min_ver_late" is the minimal version of the currently loaded microcode
Packit e3b5e1
   on the CPU (as reported in /proc/cpuinfo) that supports late microcode
Packit e3b5e1
   update.  Microcode update will be attempted only if the currently loaded
Packit e3b5e1
   microcode version is greater or equal the microcode version provided
Packit e3b5e1
   in the configuration option. Can be set in the configuration file only once.
Packit e3b5e1
 * "disable" is a way to disable a specific caveat from inside its
Packit e3b5e1
   configuration. Argument for the argument is a list of stages ("early",
Packit e3b5e1
   "late") for which the caveat should be disable. The configuration option
Packit e3b5e1
   can be provided multiple times in a configuration file.
Packit e3b5e1
 * "blacklist" is a marker for a start of list of blacklisted model names,
Packit e3b5e1
   one model name per line. The model name of the running CPU (as reported
Packit e3b5e1
   in /proc/cpuinfo) is compared against the names in the provided list, and,
Packit e3b5e1
   if there is a match, caveat check fails.
Packit e3b5e1
 * "pci_config_val" performs check for specific values in selected parts
Packit e3b5e1
   of configuration space of specified PCI devices.  If "-m" option
Packit e3b5e1
   is not specified, then the actual check is skipped, and the check returns
Packit e3b5e1
   result in accordance with the provided "mode" option (se below).  Check
Packit e3b5e1
   arguments are a white-space-separated list of "key=value" pairs.
Packit e3b5e1
   The following keys are supported:
Packit e3b5e1
    * "domain" - PCI domain number, or "*" (an asterisk) for any domain.
Packit e3b5e1
      Default is "*".
Packit e3b5e1
    * "bus" - PCI bus number, or "*" (an asterisk) for any bus.  Default is "*".
Packit e3b5e1
    * "device" - PCI device number, or "*" (an asterisk) for any device.
Packit e3b5e1
      Default is "*".
Packit e3b5e1
    * "function" - PCI function number, or "*" (an asterisk) for any function.
Packit e3b5e1
      Default is "*".
Packit e3b5e1
    * "vid" - PCI vendor ID, or empty string for any vendor ID.  Default
Packit e3b5e1
      is empty string.
Packit e3b5e1
    * "did" - PCI device ID, or empty string for any device ID.  Default
Packit e3b5e1
      is empty string.
Packit e3b5e1
    * "offset" - offset in device's configuration space where the value resides.
Packit e3b5e1
      Default is 0.
Packit e3b5e1
    * "size" - field size.  Possible values are 1, 2, 4, or 8.  Default is 4.
Packit e3b5e1
    * "mask" - mask applied to the values during the check.  Default is 0.
Packit e3b5e1
    * "val" - comma-separated list of matching values.  Default is 0.
Packit e3b5e1
    * "mode" - check mode, the way matches are interpreted:
Packit e3b5e1
       * "success-any" - check succeeds if there was at least one match,
Packit e3b5e1
         otherwise it fails.
Packit e3b5e1
       * "success-all" - check succeeds if there was at least one device checked
Packit e3b5e1
         and all the checked devices have matches, otherwise the check fails.
Packit e3b5e1
       * "fail-any" - check fails if there was at least one match, otherwise
Packit e3b5e1
         it succeeds.
Packit e3b5e1
       * "fail-all" - check fails if there was at least one device checked
Packit e3b5e1
         and all the checked devices have matches, otherwise the check succeeds.
Packit e3b5e1
      Default is "success-any".
Packit e3b5e1
   An example of a check:
Packit e3b5e1
       pci_config_val mode=success-all device=30 function=3 vid=0x8086 did=0x2083 offset=0x84 size=4 mask=0x38 val=0x38,0x18,0x8
Packit e3b5e1
   It interprets 4 bytes at offset 0x84 of special files "config" under
Packit e3b5e1
   directories that match glob pattern "/sys/bus/pci/devices/*:*:1e.3"
Packit e3b5e1
   as an unsigned integer value, applies mask 0x38 (thus selecting bit 5..3
Packit e3b5e1
   of it) and checks whether it is one of the values 0x38, 0x18, or 0x8 (0b111,
Packit e3b5e1
   0b011, or 0b001 in bits 5..3, respectively); if there are such files,
Packit e3b5e1
   and all the checked values in every checked file has matched at least one
Packit e3b5e1
   of the aforementioned value, then the check is successful, otherwise
Packit e3b5e1
   it fails (in accordance with "mode=success-all" semantics).  This check fails
Packit e3b5e1
   if "-m" option is not specified.
Packit e3b5e1
 * "dmi" performs checks for specific values available in DMI sysfs files
Packit e3b5e1
   (present under /sys/devices/virtual/dmi/id/).  The check fails if file
Packit e3b5e1
   is not readable.  If "-m" option is specified, then the actual check
Packit e3b5e1
   is skipped, and the check returns value in accordance with "no-model-mode"
Packit e3b5e1
   parameter value (see below).  Check arguments are a white-space-separated
Packit e3b5e1
   list of "key=value" pairs.  The following keys are supported:
Packit e3b5e1
    * "key" - DMI file to check. Value can be one of the following: bios_date,
Packit e3b5e1
      bios_vendor, bios_version, board_asset_tag, board_name, board_serial,
Packit e3b5e1
      board_vendor, board_version, chassis_asset_tag, chassis_serial,
Packit e3b5e1
      chassis_type, chassis_vendor, chassis_version, product_family,
Packit e3b5e1
      product_name, product_serial, product_uuid, product_version, sys_vendor.
Packit e3b5e1
      Default is empty string.
Packit e3b5e1
    * "val" - a string to match DMI data against.  Can be enclosed in single
Packit e3b5e1
      or double quotes.  Default is empty string.
Packit e3b5e1
    * "mode" - check mode, the way matches are interpreted:
Packit e3b5e1
       * "success-equal" - returns 0 if the value present in the file
Packit e3b5e1
         with the name supplied via the "key" parameter file under
Packit e3b5e1
	 /sys/devices/virtual/dmi/id/ is equal to the value supplied as a value
Packit e3b5e1
	 of "val" parameter, otherwise 1.
Packit e3b5e1
       * "success-equal" - returns 1 if the value present in the file
Packit e3b5e1
         with the name supplied via the "key" parameter file under
Packit e3b5e1
	 /sys/devices/virtual/dmi/id/ is equal to the value supplied as a value
Packit e3b5e1
	 of "val" parameter, otherwise 0.
Packit e3b5e1
      Default is "success-any".
Packit e3b5e1
    * "no-model-mode" - return value if model filter ("-m" option)
Packit e3b5e1
      is not enabled:
Packit e3b5e1
       * "success" - return 0.
Packit e3b5e1
       * "fail" - return 1.
Packit e3b5e1
      Default is "success".
Packit e3b5e1
   An example of a check:
Packit e3b5e1
       dmi mode=fail-equal no-model-mode=success key=bios_vendor val="Dell Inc."
Packit e3b5e1
   It checks file /sys/devices/virtual/dmi/id/bios_vendor and fails if its
Packit e3b5e1
   content is "Dell Inc." (without quotes).  It succeeds if "-m" option
Packit e3b5e1
   is not enabled.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
check_caveats script
Packit e3b5e1
--------------------
Packit e3b5e1
"check_caveats" is an utility script (called by update_ucode, reload_microcode,
Packit e3b5e1
dracut module) that performs checks of the target kernel (and running CPU)
Packit e3b5e1
in accordance with caveat configuration files in directory
Packit e3b5e1
"/usr/share/microcode_ctl/ucode_with_caveats", and returns information, whether
Packit e3b5e1
the system passes the checks, or not.
Packit e3b5e1
Packit e3b5e1
Usage:
Packit e3b5e1
    check_caveats [-e] [-k TARGET_KVER] [-c CONFIG]* [-m] [-v]'
Packit e3b5e1
Packit e3b5e1
Options:
Packit e3b5e1
  -e - check for early microcode load possibility (instead of late microcode
Packit e3b5e1
       load). "kernel_early" caveat configuration options are used for checking
Packit e3b5e1
       instead of "kernel", and "mc_min_ver_late" is not checked.
Packit e3b5e1
  -k - target kernel version to check against, $(uname -r) is used otherwise.
Packit e3b5e1
  -c - caveat(s) to check, all caveat configurations found inside
Packit e3b5e1
       $MC_CAVEATS_DATA_DIR are checked otherwise.
Packit e3b5e1
  -m - ignore caveats that do not apply to the current CPU model.
Packit e3b5e1
  -v - verbose output.
Packit e3b5e1
Packit e3b5e1
Environment:
Packit e3b5e1
  MC_CAVEATS_DATA_DIR - directory that contains caveats configurations,
Packit e3b5e1
                        "/usr/share/microcode_ctl/ucode_with_caveats"
Packit e3b5e1
			by default.
Packit e3b5e1
  FW_DIR - directory containing firmware files (per-kernel configuration
Packit e3b5e1
           overrides are checked there), "/lib/firmware" by default.
Packit e3b5e1
  CFG_DIR - directory containing global caveats overrides,
Packit e3b5e1
            "/etc/microcode_ctl/ucode_with_caveats" by default.
Packit e3b5e1
Packit e3b5e1
Output:
Packit e3b5e1
  Script returns information about caveats check results. Output has a format
Packit e3b5e1
  of "KEY VALUE1 VALUE2 ..." with KEY defining the semantics of the VALUEs.
Packit e3b5e1
  Currently, the following data is issued:
Packit e3b5e1
   - "cfgs" - list of caveats that have been processed (and not skipped
Packit e3b5e1
      due to missing "config", "readme", or a disallow-* override described
Packit e3b5e1
      below);
Packit e3b5e1
   - "skip_cfgs" - list of caveats that have been skipped (due to missing
Packit e3b5e1
     config/readme file, or because of overrides);
Packit e3b5e1
   - "paths" - list of glob patterns matching files associated with caveats
Packit e3b5e1
     that have been processed;
Packit e3b5e1
   - "ok_cfgs" - list of caveat configurations that have all the checks passed
Packit e3b5e1
     (or have enforced by one of force-* overrides described below);
Packit e3b5e1
   - "ok_paths" - list of glob patterns associated with caveat files from
Packit e3b5e1
     the "ok_cfgs" list;
Packit e3b5e1
   - "fail_cfgs" - list of caveats that have one of the checks failed.
Packit e3b5e1
   - "fail_paths" - list of glob patterns associated with caveats from the
Packit e3b5e1
     "fail_cfgs" list.
Packit e3b5e1
Packit e3b5e1
Return value:
Packit e3b5e1
  - 0 in case caveats check has passed, 1 otherwise.
Packit e3b5e1
  - In "-d" mode, 0 is always returned.
Packit e3b5e1
Packit e3b5e1
Overrides:
Packit e3b5e1
Packit e3b5e1
When check_caveats perform its checks, it also checks for presence of files
Packit e3b5e1
in specific places, and, if they exist, check_caveats skips a caveat or ignores
Packit e3b5e1
its checks; that mechanism allows overriding the information provided
Packit e3b5e1
in configuration on local systems and affect the behaviour of the microcode
Packit e3b5e1
update process.
Packit e3b5e1
Packit e3b5e1
Current list of overrides (where $FW_DIR and $CFG_DIR are the environment
Packit e3b5e1
options described earlier; $kver - the currently processed kernel version,
Packit e3b5e1
$s is the requested stage ("early" or "late"), $cfg is the caveat directory
Packit e3b5e1
name):
Packit e3b5e1
    $FW_DIR/$kver/disallow-$s-$cfg - skip a caveat for the requested stage for
Packit e3b5e1
                                     a specific kernel version..
Packit e3b5e1
    $FW_DIR/$kver/force-$s-$cfg - apply a specific caveat file for a specific
Packit e3b5e1
                                  kernel version for the requested stage without
Packit e3b5e1
				  performing any checks.
Packit e3b5e1
    $FW_DIR/$kver/disallow-$cfg - skip a caveat for any stage for a specific
Packit e3b5e1
                                  kernel version.
Packit e3b5e1
    $FW_DIR/$kver/force-$cfg - apply a specific caveat for any stage
Packit e3b5e1
                               for a specific kernel version without checks.
Packit e3b5e1
    $FW_DIR/$kver/disallow-$s - skip all caveats for a specific stage
Packit e3b5e1
                                for a specific kernel version.
Packit e3b5e1
    $CFG_DIR/disallow-$s-$cfg - skip a caveat for a specific stage for all
Packit e3b5e1
                                kernel versions.
Packit e3b5e1
    $FW_DIR/$kver/force-$s - apply all caveats for a specific stage
Packit e3b5e1
                             for a specific kernel version without checks.
Packit e3b5e1
    $CFG_DIR/force-$s-$cfg - apply a specific caveat for a specific stage for
Packit e3b5e1
                             all kernel versions without checks.
Packit e3b5e1
    $FW_DIR/$kver/disallow - skip all caveats for all stages for a specific
Packit e3b5e1
                             kernel version.
Packit e3b5e1
    $CFG_DIR/disallow-$cfg - skip a caveat for all stages for all kernel
Packit e3b5e1
                             versions.
Packit e3b5e1
    $FW_DIR/$kver/force - apply all caveats for all stages for a specific kernel
Packit e3b5e1
                          version without checks.
Packit e3b5e1
    $CFG_DIR/force-$cfg - apply a caveat for all stages for all kernel versions
Packit e3b5e1
                          without checks.
Packit e3b5e1
    $CFG_DIR/disallow-$s - skip all caveat for all kernel versions
Packit e3b5e1
                           for a specific stage.
Packit e3b5e1
    $CFG_DIR/force-$s - apply all caveats for all kernel versions for  specific
Packit e3b5e1
                        stage without checks.
Packit e3b5e1
    $CFG_DIR/disallow - skip all caveats for all stages for all kernel versions
Packit e3b5e1
                        (disable everything).
Packit e3b5e1
    $CFG_DIR/force - force all caveats for all stages for all kernel versions
Packit e3b5e1
                     (enable everything).
Packit e3b5e1
Packit e3b5e1
The "apply" action above means creating symlinks in /lib/firmware by
Packit e3b5e1
update_ucode in case of the "late" stage and adding caveat directory to the list
Packit e3b5e1
of firmware directories by dracut plugin in case of the "early" stage.
Packit e3b5e1
Packit e3b5e1
The files are checked for existence until the first match, so more specific
Packit e3b5e1
overrides can override more broad ones.
Packit e3b5e1
Packit e3b5e1
Also, a caveat is ignored if it lacks either config or readme file.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
update_ucode script
Packit e3b5e1
-------------------
Packit e3b5e1
"update_ucode" populates symlinks to microcode files in accordance with caveats
Packit e3b5e1
configuration.  It enables late microcode loading that is invoked by triggering
Packit e3b5e1
/sys/devices/system/cpu/microcode/reload file.  Since caveats depend
Packit e3b5e1
on the kernel version, symlinks are populated inside
Packit e3b5e1
"/lib/firmware/KERNEL_VERSION" directory for each installed kernel.
Packit e3b5e1
As a consequence, this script is triggered upon each kernel package installation
Packit e3b5e1
and removal.
Packit e3b5e1
Packit e3b5e1
The script has two parts: common and kernel-version-specific.
Packit e3b5e1
Packit e3b5e1
During the common part, files are populated from
Packit e3b5e1
/usr/share/microcode_ctl/intel-ucode in /lib/firmware/intel-ucode. There are
Packit e3b5e1
several possibilities to affect the process:
Packit e3b5e1
 * Presence of "/etc/microcode_ctl/intel-ucode-disallow" file leads to skipping
Packit e3b5e1
   the common part of the script.
Packit e3b5e1
 * The same for "/lib/firmware/intel-ucode-disallow".
Packit e3b5e1
Packit e3b5e1
During the kernel-version-specific part, each caveat is checked against every
Packit e3b5e1
kernel version, and those combinations, for which caveat check succeeds,
Packit e3b5e1
gets the symlinks to the associated microcode files populated.
Packit e3b5e1
 * Absence of "/lib/firmware/KERNEL_VERSION/readme-CAVEAT" prevents update_ucode
Packit e3b5e1
   from removing symlinks related to the caveat for specific kernel version.
Packit e3b5e1
 * Since the check is being done by check_caveats, all the overrides that
Packit e3b5e1
   described there also stay.
Packit e3b5e1
Packit e3b5e1
Usage:
Packit e3b5e1
    update_ucode [--action {add|remove|refresh|list}] [--kernel KERNELVER]*
Packit e3b5e1
                 [--verbose] [--dry-run] [--cleanup intel_ucode caveats_ucode]
Packit e3b5e1
                 [--skip-common] [--skip-kernel-specific]
Packit e3b5e1
Packit e3b5e1
Options:
Packit e3b5e1
  --action - action to perform. Currently, the following actions are supported:
Packit e3b5e1
              * "add" - create new symlinks.
Packit e3b5e1
              * "remove" - remove old symlinks that are no longer needed.
Packit e3b5e1
              * "refresh" - re-populate symlinks.
Packit e3b5e1
              * "list" - list files under control of update_ucode.
Packit e3b5e1
             By default, "refresh" action is executed.
Packit e3b5e1
  --kernel - kernel version to process. By default, list of kernel versions
Packit e3b5e1
             is formed based on contents of /lib/firmware and /lib/modules
Packit e3b5e1
             directories.
Packit e3b5e1
  --verbose - verbose output.
Packit e3b5e1
  --dry-run - do not call commands, just print the invocation lines.
Packit e3b5e1
  --cleanup - cleanup mode. Used by post-uninstall script during package
Packit e3b5e1
              upgrades. Removes excess files in accordance to the contents
Packit e3b5e1
              of the files provided in the arguments to the option.
Packit e3b5e1
  --skip-common - do not process /lib/firmware directory.
Packit e3b5e1
  --skip-kernel-specific - do not process /lib/firmware/KERNEL_VERSION
Packit e3b5e1
                           directories.
Packit e3b5e1
Packit e3b5e1
Return value:
Packit e3b5e1
  0 on success, 1 on error.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
reload_microcode script
Packit e3b5e1
-----------------------
Packit e3b5e1
"reload_microcode" is a script that is called by microcode.service and
Packit e3b5e1
triggers late microcode reloading (by writing "1" to
Packit e3b5e1
/sys/devices/system/cpu/microcode/reload) if the following check are passed:
Packit e3b5e1
 * the microcode update performed not in a virtualised environment;
Packit e3b5e1
 * running kernel passes "check_caveats" checks that applicable to the current
Packit e3b5e1
   CPU model.
Packit e3b5e1
Packit e3b5e1
For a virtualised environment check, the script searches the "/proc/cpuinfo"
Packit e3b5e1
file for presence of the "hypervisor" flag among CPU features (it corresponds
Packit e3b5e1
to a CPUID feature bit set by hypervisors in order to inform that the kernel
Packit e3b5e1
operates inside a virtual machine).  This check can be overridden and skipped
Packit e3b5e1
by creation of a file "/etc/microcode_ctl/ignore-hypervisor-flag".
Packit e3b5e1
Packit e3b5e1
The script has no options and always returns 0.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
99microcode_ctl-fw_dir_override dracut module
Packit e3b5e1
---------------------------------------------
Packit e3b5e1
This dracut module injects directories with microcode files for caveats
Packit e3b5e1
that pass "early" check_caveats check (with "-e" flag). In addition
Packit e3b5e1
to "check_caveats" overrides, the following abilities to control module's
Packit e3b5e1
behaviour are present:
Packit e3b5e1
 * Presence of one of the following files:
Packit e3b5e1
   - /etc/microcode_ctl/ucode_with_caveats/skip-host-only-check
Packit e3b5e1
   - /etc/microcode_ctl/ucode_with_caveats/skip-host-only-check-$cfg
Packit e3b5e1
   - /lib/firmware/$kver/skip-host-only-check
Packit e3b5e1
   - /lib/firmware/$kver/skip-host-only-check-$cfg
Packit e3b5e1
   (where "$kver" is the kernel version in question and "$cfg" is the caveat
Packit e3b5e1
   directory name) allows skipping matching of microcode file name when dracut's
Packit e3b5e1
   Host-Only mode is enabled.
Packit e3b5e1
Packit e3b5e1
When caveats_check succeeds, caveats directory (not its possibly populated
Packit e3b5e1
version for late microcode update: "/lib/firmware/KERNEL_VERSION";
Packit e3b5e1
it is done so in order
Packit e3b5e1
to have ability to configure list of caveats enabled for early and late
Packit e3b5e1
microcode update, independently) is added to dracut's list of firmware search
Packit e3b5e1
directories.
Packit e3b5e1
Packit e3b5e1
The module can be disabled by running dracut with
Packit e3b5e1
"-o microcode_ctl-fw_dir_override" (for one-time exclusion), or it can
Packit e3b5e1
be disabled permanently by uncommenting string
Packit e3b5e1
"omit_dracutmodules+=' microcode_ctl-fw_dir_override '" in
Packit e3b5e1
/usr/lib/dracut/dracut.conf.d/99-microcode-override.conf configuration file.
Packit e3b5e1
Packit e3b5e1
See dracut(8), section "Omitting dracut Modules", and dracut.conf(5), variable
Packit e3b5e1
"omit_dracutmodules" for additional information.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Caveats
Packit e3b5e1
=======
Packit e3b5e1
Packit e3b5e1
Intel Broadwell-EP/EX ("BDX-ML B/M/R0") caveat
Packit e3b5e1
----------------------------------------------
Packit e3b5e1
Microcode update process on Intel Broadwell-EP/EX CPUs (BDX-ML B/M/R0,
Packit e3b5e1
family 6, model 79, stepping 1) has issues that lead to system instability.
Packit e3b5e1
A series of changes for the Linux kernel has been developed in order to work
Packit e3b5e1
around those issues; however, as it turned out, some systems have issues even
Packit e3b5e1
when a microcode update performed on a kernel that contains those changes.
Packit e3b5e1
As a result, microcode update for this CPU model is disabled by default;
Packit e3b5e1
the microcode file, however, is still shipped as a part of microcode_ctl
Packit e3b5e1
package and can be used for performing a microcode update if it is enforced
Packit e3b5e1
via the aforementioned overrides. (See the sections "check_caveats script"
Packit e3b5e1
and "reload_microcode script" for details.)
Packit e3b5e1
Packit e3b5e1
Caveat name: intel-06-4f-01
Packit e3b5e1
Packit e3b5e1
Affected microcode: intel-ucode/06-4f-01.
Packit e3b5e1
Packit e3b5e1
Mitigation: microcode loading is disabled for the affected CPU model.
Packit e3b5e1
Packit e3b5e1
Minimum versions of the kernel package that contain the aforementioned patch
Packit e3b5e1
series:
Packit e3b5e1
 - Upstream/RHEL 8: 4.17.0
Packit e3b5e1
 - RHEL 7.6 onwards:  3.10.0-894
Packit e3b5e1
 - RHEL 7.5:  3.10.0-862.6.1
Packit e3b5e1
 - RHEL 7.4:  3.10.0-693.35.1
Packit e3b5e1
 - RHEL 7.3:  3.10.0-514.52.1
Packit e3b5e1
 - RHEL 7.2:  3.10.0-327.70.1
Packit e3b5e1
 - RHEL 6.10: 2.6.32-754.1.1
Packit e3b5e1
 - RHEL 6.7:  2.6.32-573.58.1
Packit e3b5e1
 - RHEL 6.6:  2.6.32-504.71.1
Packit e3b5e1
 - RHEL 6.5:  2.6.32-431.90.1
Packit e3b5e1
 - RHEL 6.4:  2.6.32-358.90.1
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Early microcode load inside a virtual machine
Packit e3b5e1
---------------------------------------------
Packit e3b5e1
RHEL 8 kernel supports performing microcode update during early boot stage
Packit e3b5e1
from a cpio archive placed at the beginning of the initramfs image.  However,
Packit e3b5e1
when an early microcode update is attempted inside some virtualised
Packit e3b5e1
environments, that may result in unexpected system behaviour.
Packit e3b5e1
Packit e3b5e1
Caveat name: intel
Packit e3b5e1
Packit e3b5e1
Affected microcode: all.
Packit e3b5e1
Packit e3b5e1
Mitigation: early microcode loading is disabled for all CPU models on kernels
Packit e3b5e1
without the fix.
Packit e3b5e1
Packit e3b5e1
Minimum versions of the kernel package that contain the fix:
Packit e3b5e1
 - Upstream/RHEL 8: 4.10.0
Packit e3b5e1
 - RHEL 7.6 onwards: 3.10.0-930
Packit e3b5e1
 - RHEL 7.5: 3.10.0-862.14.1
Packit e3b5e1
 - RHEL 7.4: 3.10.0-693.38.1
Packit e3b5e1
 - RHEL 7.3: 3.10.0-514.57.1
Packit e3b5e1
 - RHEL 7.2: 3.10.0-327.73.1
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Intel Sandy Bridge-E/EN/EP caveat
Packit e3b5e1
---------------------------------
Packit e3b5e1
Microcode revision 0x718 for Intel Sandy Bridge-E/EN/EP (SNB-EP, family 6,
Packit e3b5e1
model 45, stepping 7), that was released to address MDS vulnerability,
Packit e3b5e1
and was available from microcode-20190618 up to microcode-20190508 release)
Packit e3b5e1
could lead to system instability[1][2].  In order to address this,
Packit e3b5e1
this microcode update was not used and the previous microcode revision
Packit e3b5e1
was provided instead by default; the microcode file, however, was still shipped
Packit e3b5e1
as part of microcode_ctl package and could be used for performing a microcode
Packit e3b5e1
update if it is enforced via the aforementioned overrides.  With the release
Packit e3b5e1
of 0x71a revision of the microcode (as art of microcode-20200520 release)
Packit e3b5e1
that aims at fixing the aforementioned stability issue, the latest microcode
Packit e3b5e1
revision is again used by default; it is still provided via the caveat
Packit e3b5e1
mechanism, hovewer, in order to enable ability to disable it in case such
Packit e3b5e1
a need arises.  (See the sections "check_caveats script" and "reload_microcode
Packit e3b5e1
script" for details regarding caveats mechanism operation.)
Packit e3b5e1
Packit e3b5e1
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/15
Packit e3b5e1
[2] https://access.redhat.com/solutions/4593951
Packit e3b5e1
Packit e3b5e1
Caveat name: intel-06-2d-07
Packit e3b5e1
Packit e3b5e1
Affected microcode: intel-ucode/06-2d-07.
Packit e3b5e1
Packit e3b5e1
Mitigation: None; the latest revision of the microcode file is used by default;
Packit e3b5e1
previously published microcode revision 0x714 is still available as a fallback
Packit e3b5e1
as part of "intel" caveat.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Intel Skylake-SP/W/X caveat
Packit e3b5e1
---------------------------
Packit e3b5e1
Microcode revision 0x2000065 (that was provided with microcode releases
Packit e3b5e1
microcode-20191112 up to microcode-20200520) for some CPU models that belong
Packit e3b5e1
to Intel Skylake Scalable Platform (SKL-W/X, family 6, model 85, stepping 4,
Packit e3b5e1
Workstation/HEDT segments) could lead to hangs during reboot[1].  In order
Packit e3b5e1
to address this, by default this microcode update was disabled by default and
Packit e3b5e1
and the previous 0x2000064 microcode revision was used instead; the microcode
Packit e3b5e1
file with, however, is still shipped as part of microcode_ctl package and can
Packit e3b5e1
be used for performing a microcode update if it is enforced
Packit e3b5e1
via the aforementioned overrides. With the availability of 0x2006906 revision
Packit e3b5e1
of the microcode (in the microcode-20200609 release) that fixes
Packit e3b5e1
the aforementioned issue, the latest microcode revision is again used
Packit e3b5e1
by default; it is still provided via caveat mechanism, hovewer, in order
Packit e3b5e1
to enable ability to disable it in case such a need arises.  (See the sections
Packit e3b5e1
"check_caveats script" and "reload_microcode script" for details regarding
Packit e3b5e1
caveats mechanism operation.)
Packit e3b5e1
Packit e3b5e1
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/21
Packit e3b5e1
Packit e3b5e1
Caveat name: intel-06-55-04
Packit e3b5e1
Packit e3b5e1
Affected microcode: intel-ucode/06-55-04.
Packit e3b5e1
Packit e3b5e1
Mitigation: None; the latest revision of the microcode file is used by default;
Packit e3b5e1
previously published microcode revision 0x2000064 is still available
Packit e3b5e1
as a fallback as part of "intel" caveat.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Intel Skylake-U/Y/H/S/Xeon E3 v5 caveats
Packit e3b5e1
----------------------------------------
Packit e3b5e1
Some Intel Skylake CPU models (SKL-U/Y, family 6, model 78, stepping 3;
Packit e3b5e1
and SKL-H/S/Xeon E3 v5, family 6, model 94, stepping 3) have reports of system
Packit e3b5e1
hangs when revision 0xdc of microcode, that is included in microcode-20200609
Packit e3b5e1
update to address CVE-2020-0543, CVE-2020-0548, and CVE-2020-0549,
Packit e3b5e1
is applied[1][2].  In order to address this, microcode update to the newer
Packit e3b5e1
revision has been disabled by default on these systems, and the previously
Packit e3b5e1
published microcode revision 0xd6 is used instead; the newer microcode files,
Packit e3b5e1
however, are still shipped as part of microcode_ctl package and can be used
Packit e3b5e1
for performing a microcode update if they are enforced via the aforementioned
Packit e3b5e1
overrides.  (See the sections "check_caveats script" and "reload_microcode
Packit e3b5e1
script" for details.)
Packit e3b5e1
Packit e3b5e1
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31
Packit e3b5e1
[2] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/31#issuecomment-644885826
Packit e3b5e1
Packit e3b5e1
Caveat names: intel-06-4e-03, intel-06-5e-03
Packit e3b5e1
Packit e3b5e1
Affected microcode: intel-ucode/06-4e-03, intel-ucode/06-5e-03.
Packit e3b5e1
Packit e3b5e1
Mitigation: previously published microcode revision 0xd6 is used by default.
Packit e3b5e1
Packit e3b5e1
Packit e3b5e1
Dell caveats
Packit e3b5e1
------------
Packit e3b5e1
Some Dell systems that use some models of Intel CPUs are susceptible to hangs
Packit e3b5e1
and system instability during or after microcode update to revision 0xc6/0xca
Packit e3b5e1
(included as part of microcode-20191113/microcode-20191115 update that addressed
Packit e3b5e1
CVE-2019-0117, CVE-2019-0123, CVE-2019-11135, and CVE-2019-11139)
Packit e3b5e1
and/or revision 0xd6 (included as part of microcode-20200609 update
Packit e3b5e1
that addressed CVE-2020-0543, CVE-2020-0548, and CVE-2020-0549)
Packit e3b5e1
[1][2][3][4][5][6].  In order to address this, microcode update to the newer
Packit e3b5e1
revision has been disabled by default on these systems, and the previously
Packit e3b5e1
published microcode revisions 0xae/0xb4/0xb8 are used by default
Packit e3b5e1
for the OS-driven microcode update.
Packit e3b5e1
Packit e3b5e1
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/23
Packit e3b5e1
[2] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/24
Packit e3b5e1
[3] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/33
Packit e3b5e1
[4] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/34
Packit e3b5e1
[5] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/35
Packit e3b5e1
[6] https://bugzilla.redhat.com/show_bug.cgi?id=1846097
Packit e3b5e1
Packit e3b5e1
Caveat names: intel-06-8e-9e-0x-dell, intel-06-8e-9e-0x-0xca
Packit e3b5e1
Packit e3b5e1
Affected microcode: intel-ucode/06-8e-09, intel-ucode/06-8e-0a,
Packit e3b5e1
                    intel-ucode/06-8e-0b, intel-ucode/06-8e-0c,
Packit e3b5e1
                    intel-ucode/06-9e-09, intel-ucode/06-9e-0a,
Packit e3b5e1
                    intel-ucode/06-9e-0b, intel-ucode/06-9e-0c,
Packit e3b5e1
                    intel-ucode/06-9e-0d.
Packit e3b5e1
Packit e3b5e1
Mitigation: previously published microcode revision 0xac/0xb4/0xb8 is used
Packit e3b5e1
            by default if /sys/devices/virtual/dmi/id/bios_vendor reports
Packit e3b5e1
	    "Dell Inc."; otherwise, the latest microcode revision is used.
Packit e3b5e1
	    Caveat with revision 0xca of microcode files is provided
Packit e3b5e1
	    as a convenience for the cases where it was working well before.
Packit e3b5e1
Packit e3b5e1
Packit Service 10856b
Intel Tiger Lake-UP3/UP4 caveat
Packit Service 10856b
-------------------------------
Packit Service 10856b
Some systems with Intel Tiger Lake-UP3/UP4 CPUs (TGL, family 6, model 140,
Packit Service 10856b
stepping 1) have reports of system hangs when a microcode update,
Packit Service 10856b
that is included since microcode-20201110 release, is applied[1].
Packit Service 10856b
In order to address this, microcode update to a newer revision has been disabled
Packit Service 10856b
by default on these systems; the newer microcode file, however, is still shipped
Packit Service 10856b
as a part of microcode_ctl package and can be used for performing a microcode
Packit Service 10856b
update if it is enforced via the aforementioned overrides.  (See the sections
Packit Service 10856b
"check_caveats script" and "reload_microcode script" for details.)
Packit Service 10856b
Packit Service 10856b
[1] https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files/issues/44
Packit Service 10856b
Packit Service 10856b
Caveat names: intel-06-8c-01
Packit Service 10856b
Packit Service 10856b
Affected microcode: intel-ucode/06-8c-01.
Packit Service 10856b
Packit Service 10856b
Mitigation: microcode loading is disabled for the affected CPU model.
Packit Service 10856b
Packit Service 10856b
Packit e3b5e1
Packit e3b5e1
Additional information
Packit e3b5e1
======================
Packit e3b5e1
Red Hat provides updated microcode, developed by its microprocessor partners,
Packit e3b5e1
as a customer convenience.  Please contact your hardware vendor to determine
Packit e3b5e1
whether more recent BIOS/firmware updates are recommended because additional
Packit e3b5e1
improvements may be available.
Packit e3b5e1
Packit e3b5e1
Information regarding microcode revisions required for mitigating specific
Packit e3b5e1
Intel CPU vulnerabilities is available in the following knowledge base articles:
Packit e3b5e1
 * CVE-2017-5715 ("Spectre"):
Packit e3b5e1
   https://access.redhat.com/articles/3436091
Packit e3b5e1
 * CVE-2018-3639 ("Speculative Store Bypass"):
Packit e3b5e1
   https://access.redhat.com/articles/3540901
Packit e3b5e1
 * CVE-2018-3620, CVE-2018-3646 ("L1 Terminal Fault Attack"):
Packit e3b5e1
   https://access.redhat.com/articles/3562741
Packit e3b5e1
 * CVE-2018-12130, CVE-2018-12126, CVE-2018-12127, and CVE-2019-11091
Packit e3b5e1
   ("Microarchitectural Data Sampling"):
Packit e3b5e1
   https://access.redhat.com/articles/4138151
Packit e3b5e1
 * CVE-2019-0117 (Intel SGX Information Leak),
Packit e3b5e1
   CVE-2019-0123 (Intel SGX Privilege Escalation),
Packit e3b5e1
   CVE-2019-11135 (TSX Asynchronous Abort),
Packit e3b5e1
   CVE-2019-11139 (Voltage Setting Modulation):
Packit e3b5e1
   https://access.redhat.com/solutions/2019-microcode-nov
Packit e3b5e1
 * CVE-2020-0543 (Special Register Buffer Data Sampling),
Packit e3b5e1
   CVE-2020-0548 (Vector Register Data Sampling),
Packit e3b5e1
   CVE-2020-0549 (L1D Cache Eviction Sampling):
Packit e3b5e1
   https://access.redhat.com/solutions/5142751
Packit Service 10856b
 * CVE-2020-8695 (Information disclosure issue in Intel SGX via RAPL interface),
Packit Service 10856b
   CVE-2020-8696 (Vector Register Leakage-Active),
Packit Service 10856b
   CVE-2020-8698 (Fast Forward Store Predictor):
Packit Service 10856b
   https://access.redhat.com/articles/5569051