Skip to content

Commit

Permalink
ENH: CPU feature check for AMD and Intel CPUs
Browse files Browse the repository at this point in the history
Builds on @skarekrow's PR pr1ntf#153 to check for AMD CPUs and handle
when an Intel 5500 Xeon series CPU (Only ones missing "UG" CPU
feature) are used.

This is needed for underlying bhyve support.
  • Loading branch information
EpiJunkie committed May 6, 2016
1 parent a214a12 commit 414fa74
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions iohyve
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
# Set proper path thanks to iocage
PATH=${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin

if ! $(cat /var/run/dmesg.boot | egrep -q 'VT-x|EPT') ; then
echo "Your CPU does not seem to support bhyve."
exit 1
# Check to see if CPU is compatible with bhyve
if [ $( cat /var/run/dmesg.boot | grep 'POPCNT' ) ]; then
if [ -n "$( cat /var/run/dmesg.boot | grep 'CPU:' | grep 'Intel' )" ] && [ -z "$( cat /var/run/dmesg.boot | grep 'VT-x:' | grep 'UG' )" ]; then
echo "Your CPU does not seem to fully support bhyve. Missing UG feature on Intel CPU, please upgrade to 5600 series."
exit 1
fi
else
echo "Your CPU does not seem to support bhyve."
echo "For AMD CPUs this means RVI. For Intel CPUs this means EPT."
exit 1
fi

# Check if libs are available (stolen from iocage)
Expand Down

0 comments on commit 414fa74

Please sign in to comment.