383126
#! /bin/bash -efu
383126
383126
# Trigger microcode reload with additional check for BDW-EP that can have
383126
# microcode reloaded only in case kernel has specific patches.
383126
#
383126
# SPDX-License-Identifier: CC0-1.0
383126
383126
CHECK_CAVEATS=/usr/libexec/microcode_ctl/check_caveats
383126
IGNORE_HYPERVISOR="/etc/microcode_ctl/ignore-hypervisor-flag"
383126
383126
[ -e "$IGNORE_HYPERVISOR" ] || {
383126
	if grep -q '^flags[[:space:]]*:.* hypervisor\( .*\)\?$' /proc/cpuinfo
383126
	then
383126
		exit 0
383126
	fi
383126
}
383126
383126
"$CHECK_CAVEATS" -m > /dev/null || exit 0
383126
383126
echo 2>/dev/null 1 > /sys/devices/system/cpu/microcode/reload || :
383126
383126
exit 0