File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,12 @@ function check_cpu_flag() {
296296 if lscpu | grep -o " ^Flags\b.*: .*\b${HOST_CPU_FLAG} \b" > /dev/null; then
297297 return 0
298298 else
299+ # AMD CPUs report invtsc as constant_tsc; check for equivalence
300+ if [ " ${HOST_CPU_FLAG} " == " invtsc" ] && [ " ${HOST_CPU_VENDOR} " == " AuthenticAMD" ]; then
301+ if lscpu | grep -o " ^Flags\b.*: .*\bconstant_tsc\b" > /dev/null; then
302+ return 0
303+ fi
304+ fi
299305 return 1
300306 fi
301307 fi
@@ -465,6 +471,11 @@ function configure_cpu() {
465471 x2apic xgetbv1 xsave xsaveopt; do
466472 CPU+=$( configure_cpu_flag " ${FLAG} " )
467473 done
474+ # AMD CPUs with constant_tsc need explicit TSC flags for macOS stability
475+ # constant_tsc is AMD's equivalent of Intel's invtsc
476+ if [ " ${HOST_CPU_VENDOR} " == " AuthenticAMD" ] && check_cpu_flag invtsc; then
477+ CPU+=" ,+tsc,+tsc-deadline,+invtsc"
478+ fi
468479 fi
469480
470481 # Disable S3 support in the VM to prevent macOS suspending during install
You can’t perform that action at this time.
0 commit comments