Enabling the bits in cpuid appears to be sufficient. We already allow
the guest to set CR4_SMAP and _SMEP.
Details
Details
- Reviewers
grehan kib jhb - Group Reviewers
bhyve - Commits
- rG4c599db71af5: vmm: Let guests enable SMEP/SMAP if the host supports it
I booted a FreeBSD VM on an Intel system that implements SMAP, and verified
that the CPU feature is recognized and that it actually works (by adding
an access to user memory into a system call).
I do not have an AMD system I can use to test this; any assistance here would be
appreciated.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
From dmesg on a FreeBSD-14 guest on a Ryzen 4700U.
Host:
Structured Extended Features=0x219c91a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,PQM,PQE,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,SHA>
Guest before the change:
Structured Extended Features=0x20040129<FSGSBASE,BMI1,AVX2,BMI2,RDSEED,SHA>
Guest with the change:
Structured Extended Features=0x201401a9<FSGSBASE,BMI1,AVX2,SMEP,BMI2,RDSEED,SMAP,SHA>