HomeFreeBSD

vmm: add tunable to trap WBINVD

Description

vmm: add tunable to trap WBINVD

x86 is cache coherent. However, there are special cases where cache
coherency isn't ensured (e.g. when switching the caching mode). In these
cases, WBINVD can be used. WBINVD writes all cache lines back into main
memory and invalidates the whole cache.

Due to the invalidation of the whole cache, WBINVD is a very heavy
instruction and degrades the performance on all cores. So, we should
minimize the use of WBINVD as much as possible.

In a virtual environment, the WBINVD call is mostly useless. The guest
isn't able to break cache coherency because he can't switch the physical
cache mode. When using pci passthrough WBINVD might be useful.

Nevertheless, trapping and ignoring WBINVD is an unsafe operation. For
that reason, we implement it as tunable.

Reviewed by: jhb
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35253

Details

Provenance
corvinkAuthored on May 30 2022, 8:02 AM
manuCommitted on May 30 2022, 8:04 AM
Reviewer
jhb
Differential Revision
D35253: vmm: add tunable to trap WBINVD
Parents
rG8284799a2329: bhyve: use bhyve_config for SMBIOS strings
Branches
Unknown
Tags
Unknown