Re: embedded emulation: bhyve + vt-x on amd fx-8320

From: Dale Scott <dalescott_at_shaw.ca>
Date: Sat, 22 Apr 2023 21:16:02 UTC
----- Original Message -----
> From: "Tomek CEDRO" <tomek@cedro.info>
> To: "FreeBSD Questions Mailing List" <freebsd-questions@freebsd.org>, freebsd-emulation@freebsd.org
> Sent: Saturday, April 22, 2023 1:11:14 PM
> Subject: Re: embedded emulation: bhyve + vt-x on amd fx-8320

> CPU: AMD FX(tm)-8320 Eight-Core Processor            (3512.01-MHz K8-class CPU)
>  Origin="AuthenticAMD"  Id=0x600f20  Family=0x15  Model=0x2  Stepping=0
> Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
> Features2=0x3e98320b<SSE3,PCLMULQDQ,MON,SSSE3,FMA,CX16,SSE4.1,SSE4.2,POPCNT,AESNI,XSAVE,OSXSAVE,AVX,F16C>
>  AMD Features=0x2e500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM>
>  AMD
>  Features2=0x1ebbfff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS,XOP,SKINIT,WDT,LWP,FMA4,TCE,NodeId,TBM,Topology,PCXC,PNXC>
>  Structured Extended Features=0x8<BMI1>
>  SVM: NP,NRIP,VClean,AFlush,DAssist,NAsids=65536
>  TSC: P-state invariant, performance statistics
> real memory  = 34359738368 (32768 MB)
> avail memory = 33236238336 (31696 MB)

From the handbook https://docs.freebsd.org/en/books/handbook/virtualization/#virtualization-host-bhyve

"The easiest way to tell if a processor supports bhyve is to run dmesg or look in /var/run/dmesg.boot for the POPCNT processor feature flag on the Features2 line for AMD® processors or EPT and UG on the VT-x line for Intel® processors."

Unfortunately it seems you might be out of luck.

Following is from dmesg on my server (an older HP desktop box with a 4-core 8-thread Intel CPU). Curiously POPCNT appears in the Features2 line, but per the handbook it's the EPT and UG in the VT-x line that's important for an Intel processor.

I am also trying to configure a Bhyve vm for the first time, and will find out soon if I need to dig into the BIOS...

CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (3392.76-MHz K8-class CPU)
  Origin="GenuineIntel"  Id=0x206a7  Family=0x6  Model=0x2a  Stepping=7
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x1fbae3ff<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX>
  AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM>
  AMD Features2=0x1<LAHF>
  XSAVE Features=0x1<XSAVEOPT>
  VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID
  TSC: P-state invariant, performance statistics

Cheers,
Dale