Changeset View
Changeset View
Standalone View
Standalone View
head/sys/amd64/vmm/vmm_host.c
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | vmm_host_state_init(void) | ||||
* We always want CR0.TS to be set when the processor does a VM exit. | * We always want CR0.TS to be set when the processor does a VM exit. | ||||
* | * | ||||
* With emulation turned on unconditionally after a VM exit, we are | * With emulation turned on unconditionally after a VM exit, we are | ||||
* able to trap inadvertent use of the FPU until the guest FPU state | * able to trap inadvertent use of the FPU until the guest FPU state | ||||
* has been safely squirreled away. | * has been safely squirreled away. | ||||
*/ | */ | ||||
vmm_host_cr0 = rcr0() | CR0_TS; | vmm_host_cr0 = rcr0() | CR0_TS; | ||||
vmm_host_cr4 = rcr4(); | /* | ||||
* On non-PCID or PCID but without INVPCID support machines, | |||||
* we flush kernel i.e. global TLB entries, by temporary | |||||
* clearing the CR4.PGE bit, see invltlb_glob(). If | |||||
* preemption occurs at the wrong time, cached vmm_host_cr4 | |||||
* might store the value with CR4.PGE cleared. Since FreeBSD | |||||
* requires support for PG_G on amd64, just set it | |||||
* unconditionally. | |||||
*/ | |||||
vmm_host_cr4 = rcr4() | CR4_PGE; | |||||
/* | /* | ||||
* Only permit a guest to use XSAVE if the host is using | * Only permit a guest to use XSAVE if the host is using | ||||
* XSAVE. Only permit a guest to use XSAVE features supported | * XSAVE. Only permit a guest to use XSAVE features supported | ||||
* by the host. This ensures that the FPU state used by the | * by the host. This ensures that the FPU state used by the | ||||
* guest is always a subset of the saved guest FPU state. | * guest is always a subset of the saved guest FPU state. | ||||
* | * | ||||
* In addition, only permit known XSAVE features where the | * In addition, only permit known XSAVE features where the | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |